aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorRoland McGrath1994-01-08 21:50:14 +0000
committerRoland McGrath1994-01-08 21:50:14 +0000
commit3935665143694e44fb1f44e80f107fea81f93cd2 (patch)
treed90030e6db14933b9d398af06b03fe788afddf83 /lib-src
parentbe06db9a3edd0cc9a68313286446e5cbc8cdb139 (diff)
downloademacs-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.c35
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
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
7GNU Emacs is free software; you can redistribute it and/or modify 7GNU Emacs is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by 8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 1, or (at your option) 9the Free Software Foundation; either version 2, or (at your option)
10any later version. 10any later version.
11 11
12GNU Emacs is distributed in the hope that it will be useful, 12GNU Emacs is distributed in the hope that it will be useful,
@@ -351,29 +351,22 @@ error (s1, s2, s3)
351pfatal_with_name (name) 351pfatal_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
365pfatal_and_delete (name) 362pfatal_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)
735char * 728char *
736get_errmsg () 729get_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
749putline (buf, err, f) 736putline (buf, err, f)