X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=inline;f=m4%2Fposix-shell.m4;h=709995ddf5b5a863fc293c45eeca48b8e8153167;hb=ee6855ea0843b56e6d9c3d6abde368ab22e5befe;hp=7f3b1e944f4ca6f98119f35073d0eb4d2b06b5ed;hpb=7a6db3dccd370c0f159669cf66b4e503d1bb8886;p=gnulib.git diff --git a/m4/posix-shell.m4 b/m4/posix-shell.m4 index 7f3b1e944..709995ddf 100644 --- a/m4/posix-shell.m4 +++ b/m4/posix-shell.m4 @@ -1,6 +1,6 @@ # Find a POSIX-conforming shell. -# Copyright (C) 2007-2008 Free Software Foundation, Inc. +# Copyright (C) 2007-2011 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -17,33 +17,37 @@ AC_DEFUN([gl_POSIX_SHELL], AC_CACHE_CHECK([for a shell that conforms to POSIX], [gl_cv_posix_shell], [gl_test_posix_shell_script=' func_return () { - (exit [$]1) + (exit [$]1) } func_success () { - func_return 0 + func_return 0 } func_failure () { - func_return 1 + func_return 1 } func_ret_success () { - return 0 + return 0 } func_ret_failure () { - return 1 + return 1 + } + subshell_umask_sanity () { + (umask 22; (umask 0); test $(umask) -eq 22) } test "[$](echo foo)" = foo && func_success && ! func_failure && func_ret_success && ! func_ret_failure && - (set x && func_ret_success y && test x = "[$]1") + (set x && func_ret_success y && test x = "[$]1") && + subshell_umask_sanity ' for gl_cv_posix_shell in \ - "$CONFIG_SHELL" "$SHELL" /bin/sh /bin/bash /bin/ksh /bin/sh5 no; do + "$CONFIG_SHELL" "$SHELL" /bin/sh /bin/bash /bin/ksh /bin/sh5 no; do case $gl_cv_posix_shell in /*) - "$gl_cv_posix_shell" -c "$gl_test_posix_shell_script" 2>/dev/null \ - && break;; + "$gl_cv_posix_shell" -c "$gl_test_posix_shell_script" 2>/dev/null \ + && break;; esac done])