diff options
Diffstat (limited to 'win32/mingw.c')
-rw-r--r-- | win32/mingw.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/win32/mingw.c b/win32/mingw.c index fe45589c2..d76f17820 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -842,6 +842,19 @@ int mingw_mkdir(const char *path, int mode UNUSED_PARAM) | |||
842 | return ret; | 842 | return ret; |
843 | } | 843 | } |
844 | 844 | ||
845 | #undef chmod | ||
846 | int mingw_chmod(const char *path, int mode) | ||
847 | { | ||
848 | WIN32_FILE_ATTRIBUTE_DATA fdata; | ||
849 | |||
850 | if ( get_file_attr(path, &fdata) == 0 && | ||
851 | fdata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) { | ||
852 | mode |= 0222; | ||
853 | } | ||
854 | |||
855 | return chmod(path, mode); | ||
856 | } | ||
857 | |||
845 | int fcntl(int fd, int cmd, ...) | 858 | int fcntl(int fd, int cmd, ...) |
846 | { | 859 | { |
847 | va_list arg; | 860 | va_list arg; |
@@ -1014,6 +1027,14 @@ int mingw_access(const char *name, int mode) | |||
1014 | return -1; | 1027 | return -1; |
1015 | } | 1028 | } |
1016 | 1029 | ||
1030 | #undef rmdir | ||
1031 | int mingw_rmdir(const char *path) | ||
1032 | { | ||
1033 | /* read-only directories cannot be removed */ | ||
1034 | chmod(path, 0666); | ||
1035 | return rmdir(path); | ||
1036 | } | ||
1037 | |||
1017 | /* check if path can be made into an executable by adding a suffix; | 1038 | /* check if path can be made into an executable by adding a suffix; |
1018 | * return an allocated string containing the path if it can; | 1039 | * return an allocated string containing the path if it can; |
1019 | * return NULL if not. | 1040 | * return NULL if not. |