From 6819ba36b3805c239c731253c0b877f0e9aec311 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 19 Jun 2008 15:08:53 +0000 Subject: Adjust strsignal to POSIX 200x prototype. 2008-06-19 Eric Blake Adjust strsignal to POSIX 200x prototype. * strsignal.c (strsignal): Remove const. From-SVN: r136949 --- libiberty/strsignal.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'libiberty/strsignal.c') diff --git a/libiberty/strsignal.c b/libiberty/strsignal.c index 4ca9e21..666b1b4 100644 --- a/libiberty/strsignal.c +++ b/libiberty/strsignal.c @@ -404,10 +404,10 @@ call to @code{strsignal}. #ifndef HAVE_STRSIGNAL -const char * +char * strsignal (int signo) { - const char *msg; + char *msg; static char buf[32]; #ifndef HAVE_SYS_SIGLIST @@ -428,14 +428,16 @@ strsignal (int signo) { /* In range, but no sys_siglist or no entry at this index. */ sprintf (buf, "Signal %d", signo); - msg = (const char *) buf; + msg = buf; } else { - /* In range, and a valid message. Just return the message. */ - msg = (const char *) sys_siglist[signo]; + /* In range, and a valid message. Just return the message. We + can safely cast away const, since POSIX says the user must + not modify the result. */ + msg = (char *) sys_siglist[signo]; } - + return (msg); } -- cgit v1.1