Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/coreutils/nice.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/nice.c
r1765 r2725 5 5 * Copyright (C) 2005 Manuel Novoa III <mjn3@codepoet.org> 6 6 * 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 8 8 */ 9 9 … … 11 11 #include "libbb.h" 12 12 13 int nice_main(int argc, char **argv) ;13 int nice_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 14 14 int nice_main(int argc, char **argv) 15 15 { … … 18 18 old_priority = getpriority(PRIO_PROCESS, 0); 19 19 20 if (!*++argv) { 20 if (!*++argv) { /* No args, so (GNU) output current nice value. */ 21 21 printf("%d\n", old_priority); 22 22 fflush_stdout_and_exit(EXIT_SUCCESS); 23 23 } 24 24 25 adjustment = 10; 25 adjustment = 10; /* Set default adjustment. */ 26 26 27 27 if (argv[0][0] == '-') { … … 33 33 argv[0] += 1; argv--; argc++; 34 34 } 35 if (argc < 4) { 35 if (argc < 4) { /* Missing priority and/or utility! */ 36 36 bb_show_usage(); 37 37 } … … 48 48 } 49 49 50 BB_EXECVP(*argv, argv); /* Now exec the desired program. */ 51 52 /* The exec failed... */ 53 xfunc_error_retval = (errno == ENOENT) ? 127 : 126; /* SUSv3 */ 54 bb_perror_msg_and_die("%s", *argv); 50 BB_EXECVP_or_die(argv); 55 51 }
Note:
See TracChangeset
for help on using the changeset viewer.