aboutsummaryrefslogtreecommitdiffstats
path: root/ports/unix
diff options
context:
space:
mode:
Diffstat (limited to 'ports/unix')
-rw-r--r--ports/unix/guts/mkdirat.c4
-rw-r--r--ports/unix/guts/mkfifoat.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/ports/unix/guts/mkdirat.c b/ports/unix/guts/mkdirat.c
index 668d6ac..ef2e3a1 100644
--- a/ports/unix/guts/mkdirat.c
+++ b/ports/unix/guts/mkdirat.c
@@ -21,6 +21,7 @@
if (rc != -1) {
PSEUDO_STATBUF buf;
int stat_rc;
+ int save_errno = errno;
#ifdef PSEUDO_NO_REAL_AT_FUNCTIONS
stat_rc = base_lstat(path, &buf);
@@ -33,12 +34,13 @@
#ifdef PSEUDO_NO_REAL_AT_FUNCTIONS
real_fchmod(path, PSEUDO_FS_MODE(mode, 1));
#else
- real_fchmodat(dirfd, path, PSEUDO_FS_MODE(mode, 1), AT_SYMLINK_NOFOLLOW);
+ real_fchmodat(dirfd, path, PSEUDO_FS_MODE(mode, 1), 0);
#endif
} else {
pseudo_debug(PDBGF_OP, "mkdir of %s succeeded, but stat failed: %s\n",
path, strerror(errno));
}
+ errno = save_errno;
}
/* return rc;
diff --git a/ports/unix/guts/mkfifoat.c b/ports/unix/guts/mkfifoat.c
index 4546ba3..6947e70 100644
--- a/ports/unix/guts/mkfifoat.c
+++ b/ports/unix/guts/mkfifoat.c
@@ -33,6 +33,7 @@
if (rc == -1) {
return -1;
}
+ save_errno = errno;
rc = base_stat(path, &buf);
real_chmod(path, PSEUDO_FS_MODE(mode, 0));
#else
@@ -40,8 +41,9 @@
if (rc == -1) {
return -1;
}
+ save_errno = errno;
rc = base_fstatat(dirfd, path, &buf, AT_SYMLINK_NOFOLLOW);
- real_fchmodat(dirfd, path, PSEUDO_FS_MODE(mode, 0), AT_SYMLINK_NOFOLLOW);
+ real_fchmodat(dirfd, path, PSEUDO_FS_MODE(mode, 0), 0);
#endif
/* if the stat failed, we are going to give up and nuke
* any file we may have created, and hope for the best.