diff options
| author | Roland McGrath | 1994-01-08 21:50:14 +0000 |
|---|---|---|
| committer | Roland McGrath | 1994-01-08 21:50:14 +0000 |
| commit | 3935665143694e44fb1f44e80f107fea81f93cd2 (patch) | |
| tree | d90030e6db14933b9d398af06b03fe788afddf83 /lib-src | |
| parent | be06db9a3edd0cc9a68313286446e5cbc8cdb139 (diff) | |
| download | emacs-3935665143694e44fb1f44e80f107fea81f93cd2.tar.gz emacs-3935665143694e44fb1f44e80f107fea81f93cd2.zip | |
(get_errmsg, pfatal_with_name, pfatal_and_delete): Call strerror instead of
using sys_errlist.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/movemail.c | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/lib-src/movemail.c b/lib-src/movemail.c index eda7767d92e..0b4163e0234 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | /* movemail foo bar -- move file foo to file bar, | 1 | /* movemail foo bar -- move file foo to file bar, |
| 2 | locking file foo the way /bin/mail respects. | 2 | locking file foo the way /bin/mail respects. |
| 3 | Copyright (C) 1986, 1992, 1993 Free Software Foundation, Inc. | 3 | Copyright (C) 1986, 1992, 1993, 1994 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
| 7 | GNU Emacs is free software; you can redistribute it and/or modify | 7 | GNU Emacs is free software; you can redistribute it and/or modify |
| 8 | it under the terms of the GNU General Public License as published by | 8 | it under the terms of the GNU General Public License as published by |
| 9 | the Free Software Foundation; either version 1, or (at your option) | 9 | the Free Software Foundation; either version 2, or (at your option) |
| 10 | any later version. | 10 | any later version. |
| 11 | 11 | ||
| 12 | GNU Emacs is distributed in the hope that it will be useful, | 12 | GNU Emacs is distributed in the hope that it will be useful, |
| @@ -351,29 +351,22 @@ error (s1, s2, s3) | |||
| 351 | pfatal_with_name (name) | 351 | pfatal_with_name (name) |
| 352 | char *name; | 352 | char *name; |
| 353 | { | 353 | { |
| 354 | extern int errno, sys_nerr; | 354 | extern int errno; |
| 355 | extern char *sys_errlist[]; | 355 | extern char *strerror (); |
| 356 | char *s; | 356 | char *s; |
| 357 | 357 | ||
| 358 | if (errno < sys_nerr) | 358 | s = concat ("", strerror (errno), " for %s"); |
| 359 | s = concat ("", sys_errlist[errno], " for %s"); | ||
| 360 | else | ||
| 361 | s = "cannot open %s"; | ||
| 362 | fatal (s, name); | 359 | fatal (s, name); |
| 363 | } | 360 | } |
| 364 | 361 | ||
| 365 | pfatal_and_delete (name) | 362 | pfatal_and_delete (name) |
| 366 | char *name; | 363 | char *name; |
| 367 | { | 364 | { |
| 368 | extern int errno, sys_nerr; | 365 | extern int errno; |
| 369 | extern char *sys_errlist[]; | 366 | extern char *strerror (); |
| 370 | char *s; | 367 | char *s; |
| 371 | 368 | ||
| 372 | if (errno < sys_nerr) | 369 | s = concat ("", strerror (errno), " for %s"); |
| 373 | s = concat ("", sys_errlist[errno], " for %s"); | ||
| 374 | else | ||
| 375 | s = "cannot open %s"; | ||
| 376 | |||
| 377 | unlink (name); | 370 | unlink (name); |
| 378 | fatal (s, name); | 371 | fatal (s, name); |
| 379 | } | 372 | } |
| @@ -735,15 +728,9 @@ multiline (buf, n, f) | |||
| 735 | char * | 728 | char * |
| 736 | get_errmsg () | 729 | get_errmsg () |
| 737 | { | 730 | { |
| 738 | extern int errno, sys_nerr; | 731 | extern int errno; |
| 739 | extern char *sys_errlist[]; | 732 | extern char *strerror (); |
| 740 | char *s; | 733 | return strerror (errno); |
| 741 | |||
| 742 | if (errno < sys_nerr) | ||
| 743 | s = sys_errlist[errno]; | ||
| 744 | else | ||
| 745 | s = "unknown error"; | ||
| 746 | return (s); | ||
| 747 | } | 734 | } |
| 748 | 735 | ||
| 749 | putline (buf, err, f) | 736 | putline (buf, err, f) |