aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-09-14 13:08:20 +1000
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-09-14 13:08:20 +1000
commit6a6efd31038d7afe977e3059508ae863e65cbdf5 (patch)
tree5cd69a751e893b83176751c80fcea7a7afeed1ae /coreutils
parenta6a2325ecf402054132daae169f71edb0fb849e3 (diff)
parent29082231d0cb1a5b327de5d515b16f332d4dbdaf (diff)
downloadbusybox-w32-6a6efd31038d7afe977e3059508ae863e65cbdf5.tar.gz
busybox-w32-6a6efd31038d7afe977e3059508ae863e65cbdf5.tar.bz2
busybox-w32-6a6efd31038d7afe977e3059508ae863e65cbdf5.zip
Merge branch 'origin/master' (early part)
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/chroot.c3
-rw-r--r--coreutils/env.c7
-rw-r--r--coreutils/nice.c6
-rw-r--r--coreutils/nohup.c4
-rw-r--r--coreutils/realpath.c2
5 files changed, 7 insertions, 15 deletions
diff --git a/coreutils/chroot.c b/coreutils/chroot.c
index f7228a61a..046c2fabf 100644
--- a/coreutils/chroot.c
+++ b/coreutils/chroot.c
@@ -30,6 +30,5 @@ int chroot_main(int argc UNUSED_PARAM, char **argv)
30 argv[1] = (char *) "-i"; 30 argv[1] = (char *) "-i";
31 } 31 }
32 32
33 BB_EXECVP(*argv, argv); 33 BB_EXECVP_or_die(argv);
34 bb_perror_msg_and_die("can't execute '%s'", *argv);
35} 34}
diff --git a/coreutils/env.c b/coreutils/env.c
index 9635d2b22..d4eab191b 100644
--- a/coreutils/env.c
+++ b/coreutils/env.c
@@ -76,11 +76,8 @@ int env_main(int argc UNUSED_PARAM, char **argv)
76 ++argv; 76 ++argv;
77 } 77 }
78 78
79 if (*argv) { 79 if (argv[0]) {
80 BB_EXECVP(*argv, argv); 80 BB_EXECVP_or_die(argv);
81 /* SUSv3-mandated exit codes. */
82 xfunc_error_retval = (errno == ENOENT) ? 127 : 126;
83 bb_simple_perror_msg_and_die(*argv);
84 } 81 }
85 82
86 if (environ) { /* clearenv() may set environ == NULL! */ 83 if (environ) { /* clearenv() may set environ == NULL! */
diff --git a/coreutils/nice.c b/coreutils/nice.c
index d24a95b45..ff3eb1140 100644
--- a/coreutils/nice.c
+++ b/coreutils/nice.c
@@ -47,9 +47,5 @@ int nice_main(int argc, char **argv)
47 } 47 }
48 } 48 }
49 49
50 BB_EXECVP(*argv, argv); /* Now exec the desired program. */ 50 BB_EXECVP_or_die(argv);
51
52 /* The exec failed... */
53 xfunc_error_retval = (errno == ENOENT) ? 127 : 126; /* SUSv3 */
54 bb_simple_perror_msg_and_die(*argv);
55} 51}
diff --git a/coreutils/nohup.c b/coreutils/nohup.c
index 4f6385f8e..3dc531409 100644
--- a/coreutils/nohup.c
+++ b/coreutils/nohup.c
@@ -75,6 +75,6 @@ int nohup_main(int argc UNUSED_PARAM, char **argv)
75 75
76 signal(SIGHUP, SIG_IGN); 76 signal(SIGHUP, SIG_IGN);
77 77
78 BB_EXECVP(argv[1], argv+1); 78 argv++;
79 bb_simple_perror_msg_and_die(argv[1]); 79 BB_EXECVP_or_die(argv);
80} 80}
diff --git a/coreutils/realpath.c b/coreutils/realpath.c
index 90a71ed7d..3bc40ee04 100644
--- a/coreutils/realpath.c
+++ b/coreutils/realpath.c
@@ -23,7 +23,7 @@ int realpath_main(int argc UNUSED_PARAM, char **argv)
23 23
24 do { 24 do {
25 char *resolved_path = xmalloc_realpath(*argv); 25 char *resolved_path = xmalloc_realpath(*argv);
26 if (resolved_path != NULL) { 26 if (resolved_path != NULL) {
27 puts(resolved_path); 27 puts(resolved_path);
28 free(resolved_path); 28 free(resolved_path);
29 } else { 29 } else {