From 69c2377280241973a395e3aedad78f4a2da33d5b Mon Sep 17 00:00:00 2001 From: CodingKoopa Date: Fri, 8 Mar 2024 06:37:05 +0000 Subject: [PATCH] ntfsusermap.c: provide mode with mkdir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The desired mkdir does not seem to exist on Cygwin. Fixes compiler error: ntfsusermap.c: In function ‘outputmap’: ntfsusermap.c:817:25: error: too few arguments to function ‘mkdir’ 817 | mkdir(fullname); | ^~~~~ In file included from /usr/include/sys/_default_fcntl.h:212, from /usr/include/sys/fcntl.h:3, from /usr/include/fcntl.h:13, from ntfsusermap.c:113: /usr/include/sys/stat.h:140:9: note: declared here 140 | int mkdir (const char *_path, mode_t __mode ); | ^~~~~ --- ntfsprogs/ntfsusermap.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ntfsprogs/ntfsusermap.c b/ntfsprogs/ntfsusermap.c index b4c41070..d8150fde 100644 --- a/ntfsprogs/ntfsusermap.c +++ b/ntfsprogs/ntfsusermap.c @@ -814,7 +814,12 @@ static boolean outputmap(const char *volume, const char *dir) /* build directory, if not present */ if (stat(fullname,&st) && (errno == ENOENT)) { printf("* Creating directory %s\n", fullname); + #ifdef __CYGWIN__ + // The one-argument mkdir is exclusive to msvcrt.dll. + mkdir(fullname, 777); + #else mkdir(fullname); + #endif } strcat(fullname, DIRSEP);