aboutsummaryrefslogtreecommitdiffstats
path: root/ports/unix/guts/mknodat.c
diff options
context:
space:
mode:
Diffstat (limited to 'ports/unix/guts/mknodat.c')
-rw-r--r--ports/unix/guts/mknodat.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ports/unix/guts/mknodat.c b/ports/unix/guts/mknodat.c
index 32a4d5b..6fd5b42 100644
--- a/ports/unix/guts/mknodat.c
+++ b/ports/unix/guts/mknodat.c
@@ -8,6 +8,7 @@
pseudo_msg_t *msg;
PSEUDO_STATBUF buf;
+ int save_errno = errno;
#ifdef PSEUDO_NO_REAL_AT_FUNCTIONS
if (dirfd != AT_FDCWD) {
@@ -50,10 +51,11 @@
rc = -1;
} else {
/* just pretend we worked */
+ errno = save_errno;
rc = 0;
}
if (rc == -1) {
- int save_errno = errno;
+ save_errno = errno;
#ifdef PSEUDO_NO_REAL_AT_FUNCTIONS
real_unlink(path);
#else