summaryrefslogtreecommitdiff
path: root/glom.c
diff options
context:
space:
mode:
authortgoodwin <tgoodwin>1998-02-24 12:00:28 +0000
committerToby Goodwin <toby@paccrat.org>2015-05-16 21:23:05 +0100
commita8c039e14eafd7933776e8616715955d52320600 (patch)
tree5e4ba86b11610c5ca9370b7e9df801730cc5f075 /glom.c
parenta3d14284af40b0d4d9bf33cf33f640c3ea6102ad (diff)
try for mkfifo()
Diffstat (limited to 'glom.c')
-rw-r--r--glom.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/glom.c b/glom.c
index e835ed2..69e4489 100644
--- a/glom.c
+++ b/glom.c
@@ -324,6 +324,12 @@ static List *mkcmdarg(Node *n) {
#elif HAVE_FIFO
+#if HAVE_MKFIFO
+/* Have POSIX mkfifo(). */
+#else
+#define mkfifo(n,m) mknod(n, S_IFIFO | m, 0)
+#endif
+
static List *mkcmdarg(Node *n) {
int fd;
char *name;
@@ -331,8 +337,9 @@ static List *mkcmdarg(Node *n) {
Estack *e = enew(Estack);
List *ret = nnew(List);
static int fifonumber = 0;
+
name = nprint("/tmp/rc%d.%d", getpid(), fifonumber++);
- if (mknod(name, S_IFIFO | 0666, 0) < 0) {
+ if (mkfifo(name, 0666) < 0) {
uerror("mknod");
return NULL;
}
@@ -360,7 +367,7 @@ static List *mkcmdarg(Node *n) {
#else
static List *mkcmdarg(Node *n) {
- rc_error("named pipes are not supported");
+ rc_error("command arguments are not supported");
return NULL;
}