aboutsummaryrefslogtreecommitdiffstats
path: root/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 /src
parent92af894ffd42bbbfdbea693385b07e7faa5cf73f (diff)
downloademacs-be06db9a3edd0cc9a68313286446e5cbc8cdb139.tar.gz
emacs-be06db9a3edd0cc9a68313286446e5cbc8cdb139.zip
(main): Call strerror instead of using sys_errlist.
Diffstat (limited to 'src')
-rw-r--r--src/emacs.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/emacs.c b/src/emacs.c
index e20f488e8cc..143a85020c5 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1,5 +1,5 @@
1/* Fully extensible Emacs, running on Unix, intended for GNU. 1/* Fully extensible Emacs, running on Unix, intended for GNU.
2 Copyright (C) 1985, 1986, 1987, 1993 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1987, 1993, 1994 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
@@ -260,7 +260,7 @@ main (argc, argv, envp)
260 int skip_args = 0; 260 int skip_args = 0;
261 extern int errno; 261 extern int errno;
262 extern sys_nerr; 262 extern sys_nerr;
263 extern char *sys_errlist[]; 263 extern char *strerror ();
264 extern void malloc_warning (); 264 extern void malloc_warning ();
265 265
266/* Map in shared memory, if we are using that. */ 266/* Map in shared memory, if we are using that. */
@@ -397,12 +397,7 @@ main (argc, argv, envp)
397 result = open (argv[skip_args], O_RDWR, 2 ); 397 result = open (argv[skip_args], O_RDWR, 2 );
398 if (result < 0) 398 if (result < 0)
399 { 399 {
400 char *errstring; 400 char *errstring = strerror (errno);
401
402 if (errno >= 0 && errno < sys_nerr)
403 errstring = sys_errlist[errno];
404 else
405 errstring = "undocumented error code";
406 fprintf (stderr, "emacs: %s: %s\n", argv[skip_args], errstring); 401 fprintf (stderr, "emacs: %s: %s\n", argv[skip_args], errstring);
407 exit (1); 402 exit (1);
408 } 403 }