lineedit: do not hang on error, but return error indicator.
[oweals/busybox.git] / coreutils / env.c
index 9635d2b22aa580b9aaa290b610f582e8ccc35efa..f50ee78693d287f708279680711fc2078d096650 100644 (file)
@@ -5,7 +5,7 @@
  * Copyright (c) 1988, 1993, 1994
  *     The Regents of the University of California.  All rights reserved.
  *
- * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  *
  * Original copyright notice is retained at the end of this file.
  *
@@ -76,11 +76,8 @@ int env_main(int argc UNUSED_PARAM, char **argv)
                ++argv;
        }
 
-       if (*argv) {
-               BB_EXECVP(*argv, argv);
-               /* SUSv3-mandated exit codes. */
-               xfunc_error_retval = (errno == ENOENT) ? 127 : 126;
-               bb_simple_perror_msg_and_die(*argv);
+       if (argv[0]) {
+               BB_EXECVP_or_die(argv);
        }
 
        if (environ) { /* clearenv() may set environ == NULL! */