aboutsummaryrefslogtreecommitdiffstats
path: root/src/sysdep.c
diff options
context:
space:
mode:
authorPaul Eggert2016-06-11 23:48:13 -0700
committerPaul Eggert2016-06-11 23:49:00 -0700
commit5932ffcd028af9fc70c9f8e731f2776a9753d81d (patch)
tree4d9ab8f89fdc526146e5571f028147afde568e3d /src/sysdep.c
parenteacdc9eb6c89346fb72535632a1c65f6483b639f (diff)
downloademacs-5932ffcd028af9fc70c9f8e731f2776a9753d81d.tar.gz
emacs-5932ffcd028af9fc70c9f8e731f2776a9753d81d.zip
emacs_strerror cleanups
* src/buffer.c, src/emacs.c, src/lread.c: Don’t include coding.h; no longer needed, now that emacs_strerror is declared by lisp.h. * src/coding.c (emacs_strerror): Remove; moved to emacs.c. * src/coding.h (emacs_strerror) [emacs]: Remove decl; moved to lisp.h. * src/emacs.c (emacs_strerror): Move here from coding.c. Do not convert result string; this is now the caller’s responsibility, as some need conversion and others don’t. * src/fileio.c (report_file_errno, report_file_notify_error): Use emacs_strerror rather than rolling it ourselves. * src/lisp.h (emacs_strerror): Move decl here from coding.h. * src/lread.c (dir_warning): Just call emacs_strerror rather than both strerror and emacs_strerror. Convert its result from locale-coding-system, since it no longer does that conversion. * src/sound.c (sound_perror): * src/sysdep.c (emacs_perror, str_collate): Use emacs_strerror, not strerror.
Diffstat (limited to 'src/sysdep.c')
-rw-r--r--src/sysdep.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index a99c2080032..56142a55cdf 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -2498,7 +2498,7 @@ void
2498emacs_perror (char const *message) 2498emacs_perror (char const *message)
2499{ 2499{
2500 int err = errno; 2500 int err = errno;
2501 char const *error_string = strerror (err); 2501 char const *error_string = emacs_strerror (err);
2502 char const *command = (initial_argv && initial_argv[0] 2502 char const *command = (initial_argv && initial_argv[0]
2503 ? initial_argv[0] : "emacs"); 2503 ? initial_argv[0] : "emacs");
2504 /* Write it out all at once, if it's short; this is less likely to 2504 /* Write it out all at once, if it's short; this is less likely to
@@ -3865,7 +3865,7 @@ str_collate (Lisp_Object s1, Lisp_Object s2,
3865 locale_t loc = newlocale (LC_COLLATE_MASK | LC_CTYPE_MASK, 3865 locale_t loc = newlocale (LC_COLLATE_MASK | LC_CTYPE_MASK,
3866 SSDATA (locale), 0); 3866 SSDATA (locale), 0);
3867 if (!loc) 3867 if (!loc)
3868 error ("Invalid locale %s: %s", SSDATA (locale), strerror (errno)); 3868 error ("Invalid locale %s: %s", SSDATA (locale), emacs_strerror (errno));
3869 3869
3870 if (! NILP (ignore_case)) 3870 if (! NILP (ignore_case))
3871 for (int i = 1; i < 3; i++) 3871 for (int i = 1; i < 3; i++)
@@ -3896,10 +3896,10 @@ str_collate (Lisp_Object s1, Lisp_Object s2,
3896 } 3896 }
3897# ifndef HAVE_NEWLOCALE 3897# ifndef HAVE_NEWLOCALE
3898 if (err) 3898 if (err)
3899 error ("Invalid locale or string for collation: %s", strerror (err)); 3899 error ("Invalid locale or string for collation: %s", emacs_strerror (err));
3900# else 3900# else
3901 if (err) 3901 if (err)
3902 error ("Invalid string for collation: %s", strerror (err)); 3902 error ("Invalid string for collation: %s", emacs_strerror (err));
3903# endif 3903# endif
3904 3904
3905 SAFE_FREE (); 3905 SAFE_FREE ();