source: MondoRescue/branches/2.2.9/mindi-busybox/coreutils/mkfifo.c@ 2725

Last change on this file since 2725 was 2725, checked in by Bruno Cornec, 13 years ago
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
File size: 844 bytes
RevLine 
[821]1/* vi: set sw=4 ts=4: */
2/*
3 * mkfifo implementation for busybox
4 *
5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
6 *
[2725]7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
[821]8 */
9
10/* BB_AUDIT SUSv3 compliant */
11/* http://www.opengroup.org/onlinepubs/007904975/utilities/mkfifo.html */
12
[1765]13#include "libbb.h"
[821]14#include "libcoreutils/coreutils.h"
15
[2725]16/* This is a NOEXEC applet. Be very careful! */
17
18int mkfifo_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
19int mkfifo_main(int argc UNUSED_PARAM, char **argv)
[821]20{
21 mode_t mode;
22 int retval = EXIT_SUCCESS;
23
[2725]24 mode = getopt_mk_fifo_nod(argv);
[821]25
[1765]26 argv += optind;
27 if (!*argv) {
[821]28 bb_show_usage();
29 }
30
31 do {
32 if (mkfifo(*argv, mode) < 0) {
[2725]33 bb_simple_perror_msg(*argv); /* Avoid multibyte problems. */
[821]34 retval = EXIT_FAILURE;
35 }
36 } while (*++argv);
37
38 return retval;
39}
Note: See TracBrowser for help on using the repository browser.