Mercurial > illumos > illumos-gate
changeset 13707:3f41b24ce657
2049 env(1) should print program it attempts to exec on error, not argv[0]
Reviewed by: Dave Pacheco <dap@joyent.com>
Reviewed by: Dan Kruchinin <dkruchinin@acm.org>
Reviewed by: Dan McDonald <danmcd@nexenta.com>
Reviewed by: Jason King <jason.brian.king@gmail.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Reviewed by: Albert Lee <trisk@nexenta.com>
Approved by: Eric Schrock <eric.schrock@delphix.com>
author | Robert Mustacchi <rm@joyent.com> |
---|---|
date | Tue, 29 May 2012 13:58:04 -0700 |
parents | b83bad61dfe1 |
children | 6d0517b1a52b |
files | usr/src/cmd/env/env.c |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/cmd/env/env.c Tue May 29 11:05:54 2012 -0400 +++ b/usr/src/cmd/env/env.c Tue May 29 13:58:04 2012 -0700 @@ -20,6 +20,9 @@ */ /* + * Copyright (c) 2012, Joyent, Inc. All rights reserved. + */ +/* * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved. */ @@ -101,7 +104,8 @@ (void) puts(*p++); } else { (void) execvp(argv[optind], &argv[optind]); - (void) perror(argv[0]); + (void) fprintf(stderr, "%s: %s: %s\n", argv[0], argv[optind], + strerror(errno)); exit(((errno == ENOENT) || (errno == ENOTDIR)) ? 127 : 126); } return (0);