diff options
author | Ron Yorston <rmy@pobox.com> | 2015-03-25 14:16:45 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2015-03-25 14:16:45 +0000 |
commit | f030c24257d48c71fd11eb2bc4c00224d2970d34 (patch) | |
tree | 923bc8828cc0abeeb284f8cc96f9a54bffe2e425 /include | |
parent | 15efec6ad51f5292a5f4d7b314219125d69e9acb (diff) | |
download | busybox-w32-f030c24257d48c71fd11eb2bc4c00224d2970d34.tar.gz busybox-w32-f030c24257d48c71fd11eb2bc4c00224d2970d34.tar.bz2 busybox-w32-f030c24257d48c71fd11eb2bc4c00224d2970d34.zip |
mingw: changes to handling of directory permissions
The read-only attribute on a directory in Microsoft Windows is
quite different from write permission in POSIX. Modify rmdir(2)
and chmod(2) to provide more POSIX-like behaviour:
rmdir will remove a directory even if it's read-only
chmod won't make a directory read-only
Diffstat (limited to 'include')
-rw-r--r-- | include/mingw.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/mingw.h b/include/mingw.h index 137548ad8..247aae587 100644 --- a/include/mingw.h +++ b/include/mingw.h | |||
@@ -257,7 +257,10 @@ NOIMPL(mingw_bind,SOCKET s UNUSED_PARAM,const struct sockaddr* sa UNUSED_PARAM,i | |||
257 | IMPL(fchmod,int,0,int fildes UNUSED_PARAM, mode_t mode UNUSED_PARAM); | 257 | IMPL(fchmod,int,0,int fildes UNUSED_PARAM, mode_t mode UNUSED_PARAM); |
258 | NOIMPL(fchown,int fd UNUSED_PARAM, uid_t uid UNUSED_PARAM, gid_t gid UNUSED_PARAM); | 258 | NOIMPL(fchown,int fd UNUSED_PARAM, uid_t uid UNUSED_PARAM, gid_t gid UNUSED_PARAM); |
259 | int mingw_mkdir(const char *path, int mode); | 259 | int mingw_mkdir(const char *path, int mode); |
260 | int mingw_chmod(const char *path, int mode); | ||
261 | |||
260 | #define mkdir mingw_mkdir | 262 | #define mkdir mingw_mkdir |
263 | #define chmod mingw_chmod | ||
261 | 264 | ||
262 | #if ENABLE_LFS | 265 | #if ENABLE_LFS |
263 | # define off_t off64_t | 266 | # define off_t off64_t |
@@ -395,12 +398,14 @@ NOIMPL(ttyname_r,int fd UNUSED_PARAM, char *buf UNUSED_PARAM, int sz UNUSED_PARA | |||
395 | int mingw_unlink(const char *pathname); | 398 | int mingw_unlink(const char *pathname); |
396 | NOIMPL(vfork,void); | 399 | NOIMPL(vfork,void); |
397 | int mingw_access(const char *name, int mode); | 400 | int mingw_access(const char *name, int mode); |
401 | int mingw_rmdir(const char *name); | ||
398 | 402 | ||
399 | #define dup2 mingw_dup2 | 403 | #define dup2 mingw_dup2 |
400 | #define getcwd mingw_getcwd | 404 | #define getcwd mingw_getcwd |
401 | #define lchown chown | 405 | #define lchown chown |
402 | #define open mingw_open | 406 | #define open mingw_open |
403 | #define unlink mingw_unlink | 407 | #define unlink mingw_unlink |
408 | #define rmdir mingw_rmdir | ||
404 | 409 | ||
405 | #undef access | 410 | #undef access |
406 | #define access mingw_access | 411 | #define access mingw_access |