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 | |
parent | 443a3f9d2744afc70b626f98111e8b345b8133bd (diff) |
Backout socket creation change as it didn't prove usefull.
Diffstat (limited to 'usr.bin/mkfifo')
-rw-r--r-- | usr.bin/mkfifo/mkfifo.1 | 20 | ||||
-rw-r--r-- | usr.bin/mkfifo/mkfifo.c | 46 |
2 files changed, 12 insertions, 54 deletions
diff --git a/usr.bin/mkfifo/mkfifo.1 b/usr.bin/mkfifo/mkfifo.1 index 10f72708b4f..e11e3722772 100644 --- a/usr.bin/mkfifo/mkfifo.1 +++ b/usr.bin/mkfifo/mkfifo.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: mkfifo.1,v 1.3 1996/08/28 07:31:49 etheisen Exp $ +.\" $OpenBSD: mkfifo.1,v 1.4 1996/08/30 07:04:32 etheisen Exp $ .\" $NetBSD: mkfifo.1,v 1.4 1994/12/23 07:16:54 jtc Exp $ .\" .\" Copyright (c) 1990, 1993 @@ -42,15 +42,14 @@ .Os BSD 4.4 .Sh NAME .Nm mkfifo -.Nd make fifos or sockets +.Nd make fifos .Sh SYNOPSIS .Nm mkfifo .Op Fl m Ar mode -.Op Fl s -.Ar filename ... +.Ar fifo_name ... .Sh DESCRIPTION .Nm Mkfifo -creates the fifos or AF_UNIX sockets requested, in the order specified, +creates the fifos requested, in the order specified, using mode .Li \&0666 modified by the current @@ -69,9 +68,6 @@ and .Dq - operators are interpreted relative to an assumed initial mode of .Dq a=rw -.It Fl s -Create AF_UNIX socket names in the file system. -This is a non-standard extension. .El .Pp .Nm Mkfifo @@ -83,13 +79,9 @@ exits 0 if successful, and >0 if an error occurred. .Xr mkdir 1 , .Xr mknod 1 , .Xr rm 1 , -.Xr mkfifo 2 , -.Xr socket 2 , -.Xr bind 2 +.Xr mkfifo 2 .Sh STANDARDS -With the exception of the -.Fl s -flag, the +The .Nm mkfifo utility is expected to be .St -p1003.2-92 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); } |