diff options
-rw-r--r-- | usr/src/uts/common/brand/lx/syscall/lx_link.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/usr/src/uts/common/brand/lx/syscall/lx_link.c b/usr/src/uts/common/brand/lx/syscall/lx_link.c index c4e8fbc93c..f2e268771e 100644 --- a/usr/src/uts/common/brand/lx/syscall/lx_link.c +++ b/usr/src/uts/common/brand/lx/syscall/lx_link.c @@ -154,6 +154,11 @@ lx_unlinkat(int atfd, char *path, int flag) if (lx_isdir(atfd, path)) return (set_errno(EISDIR)); } + if (err == EEXIST && (flag & AT_REMOVEDIR)) { + /* On Linux, an unlink of a non-empty dir returns ENOTEMPTY, not EEXIST. */ + if (lx_isdir(atfd, path)) + return (set_errno(ENOTEMPTY)); + } return (err); } |