From 5ebbef1dc0d12fa5402c97e8aa8c0c85553b87ee Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 10 Jul 2012 22:44:06 -0700 Subject: [PATCH] Assume strerror. --- ChangeLog | 5 +++++ admin/CPP-DEFINES | 2 -- admin/ChangeLog | 5 +++++ configure.ac | 2 +- lib-src/ChangeLog | 6 ++++++ lib-src/emacsclient.c | 21 --------------------- lib-src/movemail.c | 22 ---------------------- lib-src/update-game-score.c | 16 ---------------- src/ChangeLog | 5 +++++ src/sysdep.c | 15 --------------- 10 files changed, 22 insertions(+), 77 deletions(-) diff --git a/ChangeLog b/ChangeLog index b565e4802b4..85c43dd93ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-07-11 Paul Eggert + + Assume strerror. + * configure.ac (strerror): Remove check. + 2012-07-11 Glenn Morris * configure.ac (DONT_REOPEN_PTY): Move here from src/s. diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES index 7f647f1abaf..49095d7e3fc 100644 --- a/admin/CPP-DEFINES +++ b/admin/CPP-DEFINES @@ -151,7 +151,6 @@ HAVE_SHUTDOWN HAVE_SOCKETS HAVE_SOUND HAVE_STDLIB_H -HAVE_STRERROR HAVE_STRFTIME HAVE_STRING_H HAVE_STRUCT_UTIMBUF @@ -311,7 +310,6 @@ sleep spawnve srandom strdup -strerror stricmp strnicmp strupr diff --git a/admin/ChangeLog b/admin/ChangeLog index 3a71c1c8d78..60e22eb733a 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,8 @@ +2012-07-11 Paul Eggert + + Assume strerror. + * CPP-DEFINES (HAVE_STRERROR, strerror): Remove. + 2012-07-10 Dmitry Antipov * coccinelle/list_loop.cocci: Semantic patch to convert from Fcdr diff --git a/configure.ac b/configure.ac index 214569e9853..2162e1bbd0d 100644 --- a/configure.ac +++ b/configure.ac @@ -2710,7 +2710,7 @@ AC_SUBST(BLESSMAIL_TARGET) AC_CHECK_FUNCS(gethostname \ rename closedir mkdir rmdir getrusage get_current_dir_name \ lrand48 logb frexp fmod cbrt setsid \ -strerror fpathconf select euidaccess getpagesize setlocale \ +fpathconf select euidaccess getpagesize setlocale \ utimes getrlimit setrlimit setpgid getcwd shutdown getaddrinfo \ __fpending strsignal setitimer \ sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \ diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 0c517b0d571..ce4afdfec1e 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,9 @@ +2012-07-11 Paul Eggert + + Assume strerror. + * emacsclient.c, movemail.c, update-game-score.c (strerror) + [!HAVE_STRERROR]: Remove. + 2012-07-10 Paul Eggert EMACS_TIME simplification (Bug#11875). diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 5487c147079..0ba6535b79d 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -749,8 +749,6 @@ main (int argc, char **argv) #define AUTH_KEY_LENGTH 64 #define SEND_BUFFER_SIZE 4096 -extern char *strerror (int); - /* Buffer to accumulate data to send in TCP connections. */ char send_buffer[SEND_BUFFER_SIZE + 1]; int sblen = 0; /* Fill pointer for the send buffer. */ @@ -1850,22 +1848,3 @@ main (int argc, char **argv) } #endif /* HAVE_SOCKETS && HAVE_INET_SOCKETS */ - - -#ifndef HAVE_STRERROR -char * -strerror (errnum) - int errnum; -{ - extern char *sys_errlist[]; - extern int sys_nerr; - - if (errnum >= 0 && errnum < sys_nerr) - return sys_errlist[errnum]; - return (char *) "Unknown error"; -} - -#endif /* ! HAVE_STRERROR */ - - -/* emacsclient.c ends here */ diff --git a/lib-src/movemail.c b/lib-src/movemail.c index b9a1be8a7f1..aa5fd989a6d 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -133,10 +133,6 @@ static char *mail_spool_name (char *); #endif #endif -#ifndef HAVE_STRERROR -char *strerror (int); -#endif - static _Noreturn void fatal (const char *s1, const char *s2, const char *s3); static void error (const char *s1, const char *s2, const char *s3); static _Noreturn void pfatal_with_name (char *name); @@ -920,21 +916,3 @@ mbx_delimit_end (FILE *mbf) } #endif /* MAIL_USE_POP */ - -#ifndef HAVE_STRERROR -char * -strerror (errnum) - int errnum; -{ - extern char *sys_errlist[]; - extern int sys_nerr; - - if (errnum >= 0 && errnum < sys_nerr) - return sys_errlist[errnum]; - return (char *) "Unknown error"; -} - -#endif /* ! HAVE_STRERROR */ - - -/* movemail.c ends here */ diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c index 94de662e589..40397536fad 100644 --- a/lib-src/update-game-score.c +++ b/lib-src/update-game-score.c @@ -94,22 +94,6 @@ lose (const char *msg) exit (EXIT_FAILURE); } -/* Taken from sysdep.c. */ -#ifndef HAVE_STRERROR -#ifndef WINDOWSNT -char * -strerror (int errnum) -{ - extern char *sys_errlist[]; - extern int sys_nerr; - - if (errnum >= 0 && errnum < sys_nerr) - return sys_errlist[errnum]; - return (char *) "Unknown error"; -} -#endif /* not WINDOWSNT */ -#endif /* ! HAVE_STRERROR */ - static _Noreturn void lose_syserr (const char *msg) { diff --git a/src/ChangeLog b/src/ChangeLog index ed98c47d1cb..d119915643d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-07-11 Paul Eggert + + Assume strerror. + * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove. + 2012-07-11 Dmitry Antipov Avoid calls to strlen in font processing functions. diff --git a/src/sysdep.c b/src/sysdep.c index 37dc75529d0..8a27e24c792 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -1792,21 +1792,6 @@ get_random (void) return val & INTMASK; } -#ifndef HAVE_STRERROR -#ifndef WINDOWSNT -char * -strerror (int errnum) -{ - extern char *sys_errlist[]; - extern int sys_nerr; - - if (errnum >= 0 && errnum < sys_nerr) - return sys_errlist[errnum]; - return (char *) "Unknown error"; -} -#endif /* not WINDOWSNT */ -#endif /* ! HAVE_STRERROR */ - #ifndef HAVE_SNPRINTF /* Approximate snprintf as best we can on ancient hosts that lack it. */ int -- 2.39.2