diff options
-rw-r--r-- | ChangeLog.txt | 1 | ||||
-rw-r--r-- | ports/unix/guts/mknodat.c | 18 |
2 files changed, 14 insertions, 5 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index 3eef742..27921cd 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,5 +1,6 @@ 2015-07-16: * (seebs) don't truncate xattr attributes that end with a slash. + * (seebs) allow actually making fifos 2015-05-04: * (seebs) don't give spurious trailing slash diagnostics diff --git a/ports/unix/guts/mknodat.c b/ports/unix/guts/mknodat.c index 5d8d47c..d173ba5 100644 --- a/ports/unix/guts/mknodat.c +++ b/ports/unix/guts/mknodat.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Wind River Systems; see + * Copyright (c) 2011,2015 Wind River Systems; see * guts/COPYRIGHT for information. * * int mknodat(int dirfd, const char *path, mode_t mode, dev_t dev) @@ -28,11 +28,19 @@ return -1; } #ifdef PSEUDO_NO_REAL_AT_FUNCTIONS - rc = real_open(path, O_CREAT | O_WRONLY | O_EXCL, - PSEUDO_FS_MODE(mode, 0)); + if (S_ISFIFO(mode)) { + rc = real_mkfifo(path, PSEUDO_FS_MODE(mode, 0)); + } else { + rc = real_open(path, O_CREAT | O_WRONLY | O_EXCL, + PSEUDO_FS_MODE(mode, 0)); + } #else - rc = real_openat(dirfd, path, O_CREAT | O_WRONLY | O_EXCL, - PSEUDO_FS_MODE(mode, 0)); + if (S_ISFIFO(mode)) { + rc = real_mkfifoat(dirfd, path, PSEUDO_FS_MODE(mode, 0)); + } else { + rc = real_openat(dirfd, path, O_CREAT | O_WRONLY | O_EXCL, + PSEUDO_FS_MODE(mode, 0)); + } #endif if (rc == -1) { return -1; |