aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorRoland McGrath1994-01-08 21:47:36 +0000
committerRoland McGrath1994-01-08 21:47:36 +0000
commitbe06db9a3edd0cc9a68313286446e5cbc8cdb139 (patch)
tree874bf703197c96cce91b513c50309fefc2062cbc /lib-src
parent92af894ffd42bbbfdbea693385b07e7faa5cf73f (diff)
downloademacs-be06db9a3edd0cc9a68313286446e5cbc8cdb139.tar.gz
emacs-be06db9a3edd0cc9a68313286446e5cbc8cdb139.zip
(main): Call strerror instead of using sys_errlist.
Diffstat (limited to 'lib-src')
-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 @@
1/* env - manipulate environment and execute a program in that environment 1/* env - manipulate environment and execute a program in that environment
2 Copyright (C) 1986 Free Software Foundation, Inc. 2 Copyright (C) 1986, 1994 Free Software Foundation, Inc.
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
@@ -59,7 +59,7 @@
59 { USER=rms EDITOR=emacs PATH=.:/gnubin:/hacks } 59 { USER=rms EDITOR=emacs PATH=.:/gnubin:/hacks }
60 60
61 * "env DISPLAY=gnu:0 nemacs" 61 * "env DISPLAY=gnu:0 nemacs"
62 calls "nemacs" in the envionment 62 calls "nemacs" in the environment
63 { USER=rms EDITOR=emacs PATH=.:/gnubin:/hacks DISPLAY=gnu:0 } 63 { USER=rms EDITOR=emacs PATH=.:/gnubin:/hacks DISPLAY=gnu:0 }
64 64
65 * "env - USER=foo /hacks/hack bar baz" 65 * "env - USER=foo /hacks/hack bar baz"
@@ -194,17 +194,14 @@ main (argc, argv, envp)
194 } 194 }
195 else 195 else
196 { 196 {
197 extern int errno, sys_nerr; 197 extern int errno;
198 extern char *sys_errlist[]; 198 extern char *strerror ();
199 199
200 environ = nenv; 200 environ = nenv;
201 (void) execvp (*argv, argv); 201 (void) execvp (*argv, argv);
202 202
203 fprintf (stderr, "%s: cannot execute `%s'", progname, *argv); 203 fprintf (stderr, "%s: cannot execute `%s': %s\n",
204 if (errno < sys_nerr) 204 progname, *argv, strerror (errno));
205 fprintf (stderr, ": %s\n", sys_errlist[errno]);
206 else
207 putc ('\n', stderr);
208 exit (errno != 0 ? errno : 1); 205 exit (errno != 0 ? errno : 1);
209 } 206 }
210} 207}