aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2015-07-16 13:40:12 -0500
committerPeter Seebach <peter.seebach@windriver.com>2015-07-16 13:40:12 -0500
commitbf10af3c0f010ecd66647be8a3c7d72c068847bd (patch)
treeeed3b5b4036bf1d7ac0e09a0e96f3b492e6e54cf
parente84c96eda1618c0db0b89d2a9752270c8fc814f0 (diff)
downloadpseudo-bf10af3c0f010ecd66647be8a3c7d72c068847bd.tar.gz
pseudo-bf10af3c0f010ecd66647be8a3c7d72c068847bd.tar.bz2
pseudo-bf10af3c0f010ecd66647be8a3c7d72c068847bd.zip
Allow fifos
Some years back, there was a historical reason (lost to the mists of time) for which we had problems if we allowed actual creation of fifos, but so far as we know we don't expect any problems with them now, and there's a bitbake change which would like to be able to use fifos for logging, so let's try enabling them and see what happens.
-rw-r--r--ChangeLog.txt1
-rw-r--r--ports/unix/guts/mknodat.c18
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;