From 3c847aa52b7b4516c94af6ec602969b70723c421 Mon Sep 17 00:00:00 2001 From: Tamas TEVESZ Date: Thu, 23 Sep 2010 02:19:42 +0200 Subject: [PATCH] Kill wstrerror As far as i can tell, all current targets have strerror(). Signed-off-by: Tamas TEVESZ --- WINGs/WINGs/WUtil.h | 4 ---- WINGs/error.c | 29 +---------------------------- configure.ac | 2 +- 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/WINGs/WINGs/WUtil.h b/WINGs/WINGs/WUtil.h index 6849f524..471c7ec8 100644 --- a/WINGs/WINGs/WUtil.h +++ b/WINGs/WINGs/WUtil.h @@ -176,10 +176,6 @@ typedef void waborthandler(int); waborthandler* wsetabort(waborthandler* handler); - -/* don't free the returned string */ -char* wstrerror(int errnum); - enum { WMESSAGE_TYPE_MESSAGE, WMESSAGE_TYPE_WARNING, diff --git a/WINGs/error.c b/WINGs/error.c index 0e3597fb..8bfe15ef 100644 --- a/WINGs/error.c +++ b/WINGs/error.c @@ -32,33 +32,6 @@ extern char *_WINGS_progname; #define MAXLINE 1024 -/********************************************************************* - * Returns the system error message associated with error code 'errnum' - *********************************************************************/ -char *wstrerror(int errnum) -{ -#if defined(HAVE_STRERROR) - return strerror(errnum); -#elif !defined(HAVE_STRERROR) && defined(BSD) - extern int errno, sys_nerr; -# ifndef __DECC - extern char *sys_errlist[]; -# endif - static char buf[] = "Unknown error 12345678901234567890"; - - if (errno < sys_nerr) - return sys_errlist[errnum]; - - snprintf(buf, sizeof(buf), _("Unknown error %d"), errnum); - return buf; -#else /* no strerror() and no sys_errlist[] */ - static char buf[] = "Error 12345678901234567890"; - - snprintf(buf, sizeof(buf), _("Error %d"), errnum); - return buf; -#endif -} - void __wmessage(int type, void *extra, const char *msg, ...) { va_list args; @@ -89,7 +62,7 @@ void __wmessage(int type, void *extra, const char *msg, ...) msg, args); snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ": %s", type == WMESSAGE_TYPE_WSYSERROR ? - wstrerror(errno) : wstrerror(*(int *)extra)); + strerror(errno) : strerror(*(int *)extra)); break; case WMESSAGE_TYPE_MESSAGE: /* FALLTHROUGH */ diff --git a/configure.ac b/configure.ac index 568306bb..5f791a0f 100644 --- a/configure.ac +++ b/configure.ac @@ -163,7 +163,7 @@ dnl ============================ dnl not used anywhere AC_FUNC_MEMCMP AC_FUNC_VPRINTF -AC_CHECK_FUNCS(gethostname select poll strerror strcasecmp strncasecmp \ +AC_CHECK_FUNCS(gethostname select poll strcasecmp strncasecmp \ setsid atexit mallinfo mkstemp) dnl Check for inotify