1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00

Kill wstrerror

As far as i can tell, all current targets have strerror().

Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
This commit is contained in:
Tamas TEVESZ
2010-09-23 02:19:42 +02:00
committed by Carlos R. Mafra
parent 758f4c80d1
commit 3c847aa52b
3 changed files with 2 additions and 33 deletions

View File

@@ -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,

View File

@@ -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 */

View File

@@ -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