From f7ef916ed9e7e693da80a88215f36f483291c974 Mon Sep 17 00:00:00 2001 From: tg Date: Sun, 12 Nov 2006 13:35:29 +0000 Subject: [PATCH] * fix CR-LF accident * fix gcc4 warnings in autoconf tests * Debian needs for setgroups, which seems fairly POSIX Testsuite succeeds on Debian testing/unstable (i386) --- Build.sh | 21 +++++++++++---------- misc.c | 5 ++++- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Build.sh b/Build.sh index 3768362..574b54a 100644 --- a/Build.sh +++ b/Build.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $MirOS: src/bin/mksh/Build.sh,v 1.79 2006/11/12 13:15:26 tg Exp $ +# $MirOS: src/bin/mksh/Build.sh,v 1.80 2006/11/12 13:35:29 tg Exp $ #- # Environment: CC, CFLAGS, CPPFLAGS, LDFLAGS, LIBS, NROFF @@ -218,7 +218,7 @@ EOF ac_test arc4random <<-'EOF' #include - int main(void) { arc4random(); return (0); } + int main(void) { return (arc4random()); } EOF ac_test arc4random_push arc4random 0 <<-'EOF' @@ -228,20 +228,20 @@ EOF ac_test setlocale_ctype '' 'setlocale(LC_CTYPE, "")' <<'EOF' #include - int main(void) { setlocale(LC_CTYPE, ""); return (0); } + int main(void) { return ((int)setlocale(LC_CTYPE, "")); } EOF ac_test langinfo_codeset setlocale_ctype 0 'nl_langinfo(CODESET)' <<'EOF' #include - int main(void) { nl_langinfo(CODESET); return (0); } + int main(void) { return ((int)nl_langinfo(CODESET)); } EOF ac_test setmode mksh_full 1 <<-'EOF' - #if defined(__MSVCRT__) || defined(__CYGWIN__) - #error Win32 setmode() is different from what we need - #else + #if defined(__MSVCRT__) || defined(__CYGWIN__) + #error Win32 setmode() is different from what we need + #else #include - int main(int ac, char *av[]) { return (setmode(getmode(av[0], ac))); } + int main(int ac, char *av[]) { return (setmode(getmode(av[0], ac))); } #endif EOF @@ -253,18 +253,19 @@ EOF ac_test setgroups setresugid 0 <<-'EOF' #include + #include #include int main(void) { gid_t gid = 0; return (setgroups(0, &gid)); } EOF ac_test strcasestr <<-'EOF' #include - int main(int ac, char *av[]) { strcasestr(av[0], av[1]); return (ac); } + int main(int ac, char *av[]) { return ((int)strcasestr(*av, av[ac])); } EOF ac_test strlcpy <<-'EOF' #include - int main(int ac, char *av[]) { strlcpy(av[0], av[1], 1); return (ac); } + int main(int ac, char *av[]) { return (strlcpy(*av, av[1], ac)); } EOF $e ... done. diff --git a/misc.c b/misc.c index ebb4365..61b9cee 100644 --- a/misc.c +++ b/misc.c @@ -2,8 +2,11 @@ /* $OpenBSD: path.c,v 1.12 2005/03/30 17:16:37 deraadt Exp $ */ #include "sh.h" +#if HAVE_SETGROUPS +#include +#endif -__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.40 2006/11/12 12:56:10 tg Exp $\t" +__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.41 2006/11/12 13:35:29 tg Exp $\t" MKSH_SH_H_ID); #undef USE_CHVT