Mercurial > emacs
comparison src/emacs.c @ 5523:84fcbbd80e3d
(main): Call strerror instead of using sys_errlist.
author | Roland McGrath <roland@gnu.org> |
---|---|
date | Sat, 08 Jan 1994 21:47:36 +0000 |
parents | 9d548eeedc06 |
children | 1c084b38abc1 |
comparison
equal
deleted
inserted
replaced
5522:64a936b21f74 | 5523:84fcbbd80e3d |
---|---|
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 |
4 This file is part of GNU Emacs. | 4 This file is part of GNU Emacs. |
5 | 5 |
6 GNU Emacs is free software; you can redistribute it and/or modify | 6 GNU Emacs is free software; you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
258 { | 258 { |
259 char stack_bottom_variable; | 259 char stack_bottom_variable; |
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. */ |
267 #ifdef HAVE_SHM | 267 #ifdef HAVE_SHM |
268 if (argc > 1 && !strcmp (argv[1], "-nl")) | 268 if (argc > 1 && !strcmp (argv[1], "-nl")) |
395 close (0); | 395 close (0); |
396 close (1); | 396 close (1); |
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 } |
409 dup (0); | 404 dup (0); |
410 if (! isatty (0)) | 405 if (! isatty (0)) |