Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/coreutils/printenv.c
- Timestamp:
- Feb 25, 2011, 9:26:54 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi-busybox/coreutils/printenv.c
r1765 r2725 6 6 * Copyright (C) 2005 by Mike Frysinger <vapier@gentoo.org> 7 7 * 8 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.8 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 9 9 */ 10 10 11 11 #include "libbb.h" 12 extern char **environ;13 12 14 int printenv_main(int argc, char **argv); 15 int printenv_main(int argc, char **argv) 13 /* This is a NOFORK applet. Be very careful! */ 14 15 int printenv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 16 int printenv_main(int argc UNUSED_PARAM, char **argv) 16 17 { 18 int exit_code = EXIT_SUCCESS; 19 17 20 /* no variables specified, show whole env */ 18 if ( argc == 1) {21 if (!argv[1]) { 19 22 int e = 0; 20 23 while (environ[e]) … … 28 31 if (env) 29 32 puts(env); 33 else 34 exit_code = EXIT_FAILURE; 30 35 } 31 36 } 32 37 33 fflush_stdout_and_exit( 0);38 fflush_stdout_and_exit(exit_code); 34 39 }
Note:
See TracChangeset
for help on using the changeset viewer.