* use strsignal(3) not strerror(3), oops

* on GNU, that needs -D_GNU_SOURCE
* a little style(9) KNF while here
This commit is contained in:
tg 2006-08-01 12:57:07 +00:00
parent d121622e84
commit e65d9edc11
2 changed files with 8 additions and 8 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# $MirOS: src/bin/mksh/Build.sh,v 1.33 2006/07/23 18:44:22 tg Exp $ # $MirOS: src/bin/mksh/Build.sh,v 1.34 2006/08/01 12:57:07 tg Exp $
#- #-
# This script recognises CC, CFLAGS, CPPFLAGS, LDFLAGS, LIBS and NROFF. # This script recognises CC, CFLAGS, CPPFLAGS, LDFLAGS, LIBS and NROFF.
@ -63,7 +63,7 @@ Interix)
Linux) Linux)
# Hello Mr Drepper, we all like you too...</sarcasm> # Hello Mr Drepper, we all like you too...</sarcasm>
SRCS="$SRCS compat.c strlfun.c" SRCS="$SRCS compat.c strlfun.c"
CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=2 -D_BSD_SOURCE" CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=2 -D_BSD_SOURCE -D_GNU_SOURCE"
CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64 -DNEED_COMPAT" CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64 -DNEED_COMPAT"
LDSTATIC= # glibc dlopens the PAM library with getpwnam at runtime LDSTATIC= # glibc dlopens the PAM library with getpwnam at runtime
;; ;;

View File

@ -3,7 +3,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.15 2006/05/10 18:54:10 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.16 2006/08/01 12:57:07 tg Exp $");
static int histfd; static int histfd;
static int hsize; static int hsize;
@ -37,7 +37,7 @@ static Source *hist_source;
#define mksh_siglist(x) _sys_siglist[(x)] #define mksh_siglist(x) _sys_siglist[(x)]
#elif defined(__gnu_linux__) || defined(__sun__) || defined(__CYGWIN__) #elif defined(__gnu_linux__) || defined(__sun__) || defined(__CYGWIN__)
#define NEED_MKSH_SIGNAME #define NEED_MKSH_SIGNAME
#define mksh_siglist(x) strerror(x) #define mksh_siglist(x) strsignal(x)
#else #else
# error "Define sys_sig{name,list} for this platform!" # error "Define sys_sig{name,list} for this platform!"
#endif #endif
@ -986,10 +986,10 @@ mksh_signame(int s)
while (mksh_sigpair[i].name != NULL) { while (mksh_sigpair[i].name != NULL) {
if (mksh_sigpair[i].nr == s) if (mksh_sigpair[i].nr == s)
return mksh_sigpair[i].name; return (mksh_sigpair[i].name);
++i; ++i;
} }
return NULL; return (NULL);
} }
#endif #endif