Magellan Linux

Annotation of /trunk/mkinitrd-magellan/busybox/coreutils/mkfifo.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 532 - (hide annotations) (download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 8 months ago) by niro
File MIME type: text/plain
File size: 790 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd

1 niro 532 /* vi: set sw=4 ts=4: */
2     /*
3     * mkfifo implementation for busybox
4     *
5     * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
6     *
7     * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8     */
9    
10     /* BB_AUDIT SUSv3 compliant */
11     /* http://www.opengroup.org/onlinepubs/007904975/utilities/mkfifo.html */
12    
13     #include <stdlib.h>
14     #include <unistd.h>
15     #include <sys/types.h>
16     #include "busybox.h"
17     #include "libcoreutils/coreutils.h"
18    
19     int mkfifo_main(int argc, char **argv)
20     {
21     mode_t mode;
22     int retval = EXIT_SUCCESS;
23    
24     mode = getopt_mk_fifo_nod(argc, argv);
25    
26     if (!*(argv += optind)) {
27     bb_show_usage();
28     }
29    
30     do {
31     if (mkfifo(*argv, mode) < 0) {
32     bb_perror_msg("%s", *argv); /* Avoid multibyte problems. */
33     retval = EXIT_FAILURE;
34     }
35     } while (*++argv);
36    
37     return retval;
38     }