diff options
Diffstat (limited to 'ports')
-rw-r--r-- | ports/linux/guts/__xmknodat.c | 6 | ||||
-rw-r--r-- | ports/unix/guts/mknodat.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/ports/linux/guts/__xmknodat.c b/ports/linux/guts/__xmknodat.c index 296918a..4fa021b 100644 --- a/ports/linux/guts/__xmknodat.c +++ b/ports/linux/guts/__xmknodat.c @@ -11,6 +11,12 @@ /* mask out mode bits appropriately */ mode = mode & ~pseudo_umask; + /* if you don't specify a type, assume regular file */ + if (!(mode & S_IFMT)) { + mode |= S_IFREG; + } + pseudo_debug(PDBGF_FILE, "xmknodat creating '%s', mode 0%o\n", + path ? path : "<no name>", (int) mode); /* we don't use underlying call, so _ver is irrelevant to us */ (void) ver; diff --git a/ports/unix/guts/mknodat.c b/ports/unix/guts/mknodat.c index 76e4dd9..afeab46 100644 --- a/ports/unix/guts/mknodat.c +++ b/ports/unix/guts/mknodat.c @@ -12,6 +12,12 @@ /* mask out mode bits appropriately */ mode = mode & ~pseudo_umask; + /* if you don't specify a type, assume regular file */ + if (!(mode & S_IFMT)) { + mode |= S_IFREG; + } + pseudo_debug(PDBGF_FILE, "mknodat creating '%s', mode 0%o\n", + path ? path : "<no name>", (int) mode); #ifdef PSEUDO_NO_REAL_AT_FUNCTIONS if (dirfd != AT_FDCWD) { |