diff options
author | etheisen <etheisen@cvs.openbsd.org> | 1996-08-30 07:04:34 +0000 |
---|---|---|
committer | etheisen <etheisen@cvs.openbsd.org> | 1996-08-30 07:04:34 +0000 |
commit | ebc225b61cf4e7ee39c4f995e157aa0c2dd0d963 (patch) | |
tree | b2cee781c62900ebd08ec350345c275003b2c532 /usr.bin/mkfifo/mkfifo.c | |
parent | 443a3f9d2744afc70b626f98111e8b345b8133bd (diff) |
Backout socket creation change as it didn't prove usefull.
Diffstat (limited to 'usr.bin/mkfifo/mkfifo.c')
-rw-r--r-- | usr.bin/mkfifo/mkfifo.c | 46 |
1 files changed, 6 insertions, 40 deletions
diff --git a/usr.bin/mkfifo/mkfifo.c b/usr.bin/mkfifo/mkfifo.c index 58736052c46..2f6313bcd07 100644 --- a/usr.bin/mkfifo/mkfifo.c +++ b/usr.bin/mkfifo/mkfifo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mkfifo.c,v 1.3 1996/08/28 07:31:51 etheisen Exp $ */ +/* $OpenBSD: mkfifo.c,v 1.4 1996/08/30 07:04:33 etheisen Exp $ */ /* $NetBSD: mkfifo.c,v 1.7 1994/12/23 07:16:56 jtc Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)mkfifo.c 8.2 (Berkeley) 1/5/94"; #endif -static char rcsid[] = "$OpenBSD: mkfifo.c,v 1.3 1996/08/28 07:31:51 etheisen Exp $"; +static char rcsid[] = "$OpenBSD: mkfifo.c,v 1.4 1996/08/30 07:04:33 etheisen Exp $"; #endif /* not lint */ #include <stdio.h> @@ -53,16 +53,12 @@ static char rcsid[] = "$OpenBSD: mkfifo.c,v 1.3 1996/08/28 07:31:51 etheisen Exp #include <locale.h> #include <errno.h> #include <sys/types.h> -#include <sys/socket.h> -#include <sys/un.h> #include <sys/stat.h> #include <unistd.h> #include <err.h> static void usage(); -int mksocket; - int main(argc, argv) int argc; @@ -71,8 +67,6 @@ main(argc, argv) int ch, exitval; void * set; mode_t mode; - int sock; - struct sockaddr_un name; setlocale (LC_ALL, ""); @@ -81,7 +75,7 @@ main(argc, argv) modified by the file creation mask */ mode = 0666 & ~umask(0); - while ((ch = getopt(argc, argv, "m:s")) != -1) + while ((ch = getopt(argc, argv, "m:")) != -1) switch(ch) { case 'm': if (!(set = setmode(optarg))) { @@ -93,9 +87,6 @@ main(argc, argv) a=rw. */ mode = getmode (set, 0666); break; - case 's': - mksocket = 1; - break; case '?': default: usage(); @@ -105,43 +96,18 @@ main(argc, argv) if (argv[0] == NULL) usage(); - if (mksocket) { - for (exitval = 0; *argv; ++argv) { - if ((sock = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0) - goto error; - - name.sun_family = AF_UNIX; - strncpy(name.sun_path, *argv, sizeof(name.sun_path)-1); - name.sun_path[sizeof(name.sun_path) - 1]; - if (bind(sock, (struct sockaddr *)&name, - SUN_LEN(&name)) < 0) - goto error; - - if (chmod(*argv, mode) < 0) { - unlink(*argv); - goto error; - } - - continue; -error: + for (exitval = 0; *argv; ++argv) { + if (mkfifo(*argv, mode) < 0) { warn("%s", *argv); exitval = 1; } } - else { - for (exitval = 0; *argv; ++argv) { - if (mkfifo(*argv, mode) < 0) { - warn("%s", *argv); - exitval = 1; - } - } - } exit(exitval); } void usage() { - (void)fprintf(stderr, "usage: mkfifo [-m mode] [-s] filename ...\n"); + (void)fprintf(stderr, "usage: mkfifo [-m mode] fifoname ...\n"); exit(1); } |