/*
- * Copyright (c) 2009-2011 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 2009-2013 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
#include <config.h>
+#ifndef HAVE_STRSIGNAL
+
#include <sys/types.h>
#include <stdio.h>
#include "gettext.h"
#if defined(HAVE_DECL_SYS_SIGLIST) && HAVE_DECL_SYS_SIGLIST == 1
-# define my_sys_siglist sys_siglist
+# define sudo_sys_siglist sys_siglist
#elif defined(HAVE_DECL__SYS_SIGLIST) && HAVE_DECL__SYS_SIGLIST == 1
-# define my_sys_siglist _sys_siglist
+# define sudo_sys_siglist _sys_siglist
#elif defined(HAVE_DECL___SYS_SIGLIST) && HAVE_DECL___SYS_SIGLIST == 1
-# define my_sys_siglist __sys_siglist
+# define sudo_sys_siglist __sys_siglist
#else
-extern const char *const my_sys_siglist[NSIG];
+extern const char *const sudo_sys_siglist[NSIG];
#endif
/*
char *
strsignal(int signo)
{
- if (signo > 0 && signo < NSIG)
- return (char *)my_sys_siglist[signo];
+ if (signo > 0 && signo < NSIG && sudo_sys_siglist[signo] != NULL)
+ return (char *)sudo_sys_siglist[signo];
+ /* XXX - should be "Unknown signal: %d" */
return _("Unknown signal");
}
+#endif /* HAVE_STRSIGNAL */