2009-10-14 20:04:04 +00:00
|
|
|
/*
|
2013-04-24 09:35:02 -04:00
|
|
|
* Copyright (c) 2009-2013 Todd C. Miller <Todd.Miller@courtesan.com>
|
2009-10-14 20:04:04 +00:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2010-08-30 09:14:41 -04:00
|
|
|
#include <config.h>
|
|
|
|
|
2013-04-01 10:19:26 -04:00
|
|
|
#ifndef HAVE_STRSIGNAL
|
|
|
|
|
2010-08-30 09:14:41 -04:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
2009-10-14 20:04:04 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <signal.h>
|
|
|
|
|
2010-09-07 16:45:19 -04:00
|
|
|
#include "missing.h"
|
2009-10-14 20:04:04 +00:00
|
|
|
|
2011-05-20 11:48:17 -04:00
|
|
|
#define DEFAULT_TEXT_DOMAIN "sudo"
|
|
|
|
#include "gettext.h"
|
|
|
|
|
2010-04-02 07:47:19 -04:00
|
|
|
#if defined(HAVE_DECL_SYS_SIGLIST) && HAVE_DECL_SYS_SIGLIST == 1
|
2012-08-26 20:12:51 -04:00
|
|
|
# define sudo_sys_siglist sys_siglist
|
2010-04-02 07:47:19 -04:00
|
|
|
#elif defined(HAVE_DECL__SYS_SIGLIST) && HAVE_DECL__SYS_SIGLIST == 1
|
2012-08-26 20:12:51 -04:00
|
|
|
# define sudo_sys_siglist _sys_siglist
|
2010-04-02 07:47:19 -04:00
|
|
|
#elif defined(HAVE_DECL___SYS_SIGLIST) && HAVE_DECL___SYS_SIGLIST == 1
|
2012-08-26 20:12:51 -04:00
|
|
|
# define sudo_sys_siglist __sys_siglist
|
2010-04-02 07:47:19 -04:00
|
|
|
#else
|
2012-08-26 20:12:51 -04:00
|
|
|
extern const char *const sudo_sys_siglist[NSIG];
|
2010-04-02 07:47:19 -04:00
|
|
|
#endif
|
|
|
|
|
2009-10-14 20:04:04 +00:00
|
|
|
/*
|
|
|
|
* Get signal description string
|
|
|
|
*/
|
|
|
|
char *
|
2010-02-27 09:23:25 -05:00
|
|
|
strsignal(int signo)
|
2009-10-14 20:04:04 +00:00
|
|
|
{
|
2012-08-28 09:40:56 -04:00
|
|
|
if (signo > 0 && signo < NSIG && sudo_sys_siglist[signo] != NULL)
|
2012-08-26 20:12:51 -04:00
|
|
|
return (char *)sudo_sys_siglist[signo];
|
2012-08-28 09:28:25 -04:00
|
|
|
/* XXX - should be "Unknown signal: %d" */
|
2011-05-06 17:47:51 -04:00
|
|
|
return _("Unknown signal");
|
2009-10-14 20:04:04 +00:00
|
|
|
}
|
2013-04-01 10:19:26 -04:00
|
|
|
#endif /* HAVE_STRSIGNAL */
|