summaryrefslogtreecommitdiff
path: root/lib-src/env.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1994-01-08 21:47:36 +0000
committerRoland McGrath <roland@gnu.org>1994-01-08 21:47:36 +0000
commitca37005fe569a0d131497253704c39c297b0d0cd (patch)
tree0d97c41e5d149def53ee61fa54dcfb7ed89177a8 /lib-src/env.c
parent530ff85b60311a62b15ce92fff0d5c9291fc4b01 (diff)
downloademacs-ca37005fe569a0d131497253704c39c297b0d0cd.tar.gz
(main): Call strerror instead of using sys_errlist.
Diffstat (limited to 'lib-src/env.c')
-rw-r--r--lib-src/env.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib-src/env.c b/lib-src/env.c
index 853cb5bfb22..282a94069df 100644
--- a/lib-src/env.c
+++ b/lib-src/env.c
@@ -1,5 +1,5 @@
/* env - manipulate environment and execute a program in that environment
- Copyright (C) 1986 Free Software Foundation, Inc.
+ Copyright (C) 1986, 1994 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -59,7 +59,7 @@
{ USER=rms EDITOR=emacs PATH=.:/gnubin:/hacks }
* "env DISPLAY=gnu:0 nemacs"
- calls "nemacs" in the envionment
+ calls "nemacs" in the environment
{ USER=rms EDITOR=emacs PATH=.:/gnubin:/hacks DISPLAY=gnu:0 }
* "env - USER=foo /hacks/hack bar baz"
@@ -194,17 +194,14 @@ main (argc, argv, envp)
}
else
{
- extern int errno, sys_nerr;
- extern char *sys_errlist[];
+ extern int errno;
+ extern char *strerror ();
environ = nenv;
(void) execvp (*argv, argv);
- fprintf (stderr, "%s: cannot execute `%s'", progname, *argv);
- if (errno < sys_nerr)
- fprintf (stderr, ": %s\n", sys_errlist[errno]);
- else
- putc ('\n', stderr);
+ fprintf (stderr, "%s: cannot execute `%s': %s\n",
+ progname, *argv, strerror (errno));
exit (errno != 0 ? errno : 1);
}
}