diff options
| author | Toby Goodwin <tjg@star.le.ac.uk> | 1999-01-11 10:55:18 +0000 |
|---|---|---|
| committer | Toby Goodwin <toby@paccrat.org> | 2015-05-16 21:22:09 +0100 |
| commit | e11c7df86144bed383ac6bbeaecc3017d18b37db (patch) | |
| tree | 6fad44921723eab2f2eb1c76b7214b4e79b818f3 /glom.c | |
| parent | 671e1e2d1599aa8c5f1010b3fe75c151c56a7403 (diff) | |
beta: rc-1.5b4
Diffstat (limited to 'glom.c')
| -rw-r--r-- | glom.c | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -1,10 +1,10 @@ /* glom.c: builds an argument list out of words, variables, etc. */ -#include <sys/types.h> +#include "rc.h" + #include <sys/stat.h> #include <signal.h> #include <errno.h> -#include "rc.h" static List *backq(Node *, Node *); static List *bqinput(List *, int); @@ -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,9 +337,10 @@ 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) { - uerror("mknod"); + if (mkfifo(name, 0666) < 0) { + uerror("mkfifo"); return NULL; } if (rc_fork() == 0) { @@ -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; } |