summaryrefslogtreecommitdiff
path: root/usr.bin/env
diff options
context:
space:
mode:
authorMike Barcroft <mike@FreeBSD.org>2002-02-21 02:17:57 +0000
committerMike Barcroft <mike@FreeBSD.org>2002-02-21 02:17:57 +0000
commit603460a71c7b0803ac86f0ec4c01a40ec1a4bc17 (patch)
tree019a41eab7148a53aa383d382338582c792d5052 /usr.bin/env
parent014e78d18c926827f726bbb8e4d5a8b9788e5c08 (diff)
downloadsrc-test2-603460a71c7b0803ac86f0ec4c01a40ec1a4bc17.tar.gz
src-test2-603460a71c7b0803ac86f0ec4c01a40ec1a4bc17.zip
Use new ID scheme.
Fix env(1)'s exit status to conform with SUSv3. Submitted by: Tim Robbins <tim@robbins.dropbear.id.au> MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=91004
Diffstat (limited to 'usr.bin/env')
-rw-r--r--usr.bin/env/env.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.bin/env/env.c b/usr.bin/env/env.c
index 42ec003abf26..df6153deab9a 100644
--- a/usr.bin/env/env.c
+++ b/usr.bin/env/env.c
@@ -31,17 +31,23 @@
* SUCH DAMAGE.
*/
+#if 0
#ifndef lint
-static const char copyright[] =
+static char copyright[] =
"@(#) Copyright (c) 1988, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static const char sccsid[] = "@(#)env.c 8.3 (Berkeley) 4/2/94";
+static char sccsid[] = "@(#)env.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
+#endif
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
#include <err.h>
+#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -75,7 +81,7 @@ main(argc, argv)
(void)setenv(*argv, ++p, 1);
if (*argv) {
execvp(*argv, argv);
- err(1, "%s", *argv);
+ err(errno == ENOENT ? 127 : 126, "%s", *argv);
}
for (ep = environ; *ep; ep++)
(void)printf("%s\n", *ep);