From 70fd496ad8e664e1d0033a1ae4d24fdf43541b6d Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sat, 23 Apr 2016 11:30:19 -0400 Subject: [PATCH] Removed the HAVE_STRERROR directive and our replacement strerror() function for 'systems which don't have strerror()'. Seriously, people, it's 2016 and *every* system has strerror. Linux has it. FreeBSD has it. Mac OS has it. Even the vaguely unix-like OpenBSD has it. Maybe this was put in to support Tru64 or some other long-gone extinct unix, but at this point there is no longer any point in duplicating functionality which we can confidently guarantee will be in the standard C library of any usable operating system. --- citadel/support.c | 13 ------------- citadel/utils/msgform.c | 12 ------------ textclient/src/routines.c | 14 -------------- 3 files changed, 39 deletions(-) diff --git a/citadel/support.c b/citadel/support.c index 16e10e6f8..56941c36f 100644 --- a/citadel/support.c +++ b/citadel/support.c @@ -106,16 +106,3 @@ void mesg_locate(char *targ, size_t n, const char *searchfor, } -#ifndef HAVE_STRERROR -/* - * replacement strerror() for systems that don't have it - */ -char *strerror(int e) -{ - static char buf[32]; - - snprintf(buf,sizeof buf,"errno = %d",e); - return(buf); - } -#endif - diff --git a/citadel/utils/msgform.c b/citadel/utils/msgform.c index 909e6b8ed..03d94c2c7 100644 --- a/citadel/utils/msgform.c +++ b/citadel/utils/msgform.c @@ -26,18 +26,6 @@ int fpgetfield(FILE * fp, char *string); int fmout(int width, FILE * fp); -#ifndef HAVE_STRERROR -/* - * replacement strerror() for systems that don't have it - */ -char *strerror(int e) -{ - static char buf[32]; - - snprintf(buf, sizeof buf, "errno = %d", e); - return (buf); -} -#endif int main(int argc, char **argv) { diff --git a/textclient/src/routines.c b/textclient/src/routines.c index 33e05c81a..3ec4a3c98 100644 --- a/textclient/src/routines.c +++ b/textclient/src/routines.c @@ -433,20 +433,6 @@ void strproc(char *string) } -#ifndef HAVE_STRERROR -/* - * replacement strerror() for systems that don't have it - */ -char *strerror(int e) -{ - static char buf[128]; - - snprintf(buf, sizeof buf, "errno = %d",e); - return(buf); -} -#endif - - void progress(CtdlIPC* ipc, unsigned long curr, unsigned long cmax) { static char dots[] = -- 2.30.2