bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bash 2.05 'configure' unnecessarily checks for restartable syscalls


From: Paul Eggert
Subject: bash 2.05 'configure' unnecessarily checks for restartable syscalls
Date: Wed, 13 Jun 2001 09:21:14 -0700 (PDT)

Bash 2.05's 'configure' procedure tests whether system calls are
restartable by default, but Bash doesn't use the result any more.
Here is a patch to clean up the code to remove these unnecessary and
obsolescent configure-time tests.

This patch doesn't fix any bugs; it merely removes dead code.

2001-06-13  Paul Eggert  <eggert@twinsun.com>

        * aclocal.m4 (BASH_SYS_RESTARTABLE_SYSCALLS): Remove; no longer used.
        * config.h.in (HAVE_RESTARTABLE_SYSCALLS): Remove; no longer used.
        * configure.in (AC_SYS_RESTARTABLE_SYSCALLS,
        BASH_SYS_RESTARTABLE_SYSCALLS): Remove; the result is no
        longer needed.
        * subst.c: Do not include input.h; no longer needed.  This
        removes an unnecessary dependency on HAVE_RESTARTABLE_SYSCALLS, too.

===================================================================
RCS file: aclocal.m4,v
retrieving revision 2.5.0.2
retrieving revision 2.5.0.3
diff -pu -r2.5.0.2 -r2.5.0.3
--- aclocal.m4  2001/05/01 01:00:09     2.5.0.2
+++ aclocal.m4  2001/06/13 16:09:58     2.5.0.3
@@ -1438,59 +1438,6 @@ AC_DEFUN(BASH_CHECK_DECL,
   fi
 ])
 
-dnl
-dnl AC_SYS_RESTARTABLE_SYSCALLS tests only for restarted system calls
-dnl after a signal handler has been installed with signal().  Since
-dnl Bash uses sigaction() if it is available, we need to check whether
-dnl or not a signal handler installed with sigaction and SA_RESTART
-dnl causes system calls to be restarted after the signal is caught
-dnl
-AC_DEFUN(BASH_SYS_RESTARTABLE_SYSCALLS,
-[AC_REQUIRE([BASH_SIGNAL_CHECK])
-AC_CACHE_CHECK(whether posix sigaction restarts system calls by default,
-bash_cv_sys_restartable_syscalls,
-[AC_TRY_RUN(
-[/* Exit 0 (true) if wait returns something other than -1,
-   i.e. the pid of the child, which means that wait was restarted
-   after getting the signal.  */
-#ifdef HAVE_UNISTD_H
-#  include <unistd.h>
-#endif
-#include <sys/types.h>
-#include <signal.h>
-static int caught = 0;
-void ucatch (isig) int isig; { caught = 1; }
-main ()
-{
-#if !defined (_POSIX_VERSION) || !defined (HAVE_POSIX_SIGNALS)
-  exit (1);
-#else
-  struct sigaction act, oact;
-  int i, status;
-
-  act.sa_handler = ucatch;
-  /* Might want to add SA_RESTART here, but bash's set_signal_handler
-     does not. */
-  act.sa_flags = 0;
-  sigemptyset(&act.sa_mask);
-  sigemptyset(&oact.sa_mask);
-  i = fork ();
-  /* A possible race condition here, but in practice it never happens. */
-  if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); exit (0); }
-  sigaction(SIGINT, &act, &oact);
-  status = wait(&i);
-  if (status == -1) wait(&i);
-  exit (status == -1);
-#endif
-}
-], bash_cv_sys_restartable_syscalls=yes, bash_cv_sys_restartable_syscalls=no,
-   AC_MSG_WARN(cannot check restartable syscalls if cross compiling))
-])
-if test $bash_cv_sys_restartable_syscalls = yes; then
-  AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS)
-fi
-])
-
 AC_DEFUN(BASH_STRUCT_TIMEVAL,
 [AC_MSG_CHECKING(for struct timeval in sys/time.h and time.h)
 AC_CACHE_VAL(bash_cv_struct_timeval,
===================================================================
RCS file: config.h.in,v
retrieving revision 2.5.0.3
retrieving revision 2.5.0.4
diff -pu -r2.5.0.3 -r2.5.0.4
--- config.h.in 2001/05/01 01:00:09     2.5.0.3
+++ config.h.in 2001/06/13 16:09:58     2.5.0.4
@@ -386,10 +386,6 @@
 
 #undef MUST_REINSTALL_SIGHANDLERS
 
-/* Define if system calls automatically restart after interruption
-   by a signal.  */
-#undef HAVE_RESTARTABLE_SYSCALLS
-
 #undef HAVE_BSD_SIGNALS
 
 #undef HAVE_POSIX_SIGNALS
===================================================================
RCS file: configure.in,v
retrieving revision 2.5.0.4
retrieving revision 2.5.0.5
diff -pu -r2.5.0.4 -r2.5.0.5
--- configure.in        2001/06/13 15:55:56     2.5.0.4
+++ configure.in        2001/06/13 16:09:58     2.5.0.5
@@ -586,8 +586,6 @@ AC_SYS_INTERPRETER
 if test $ac_cv_sys_interpreter = yes; then
 AC_DEFINE(HAVE_HASH_BANG_EXEC)
 fi
-dnl we use NO_READ_RESTART_ON_SIGNAL
-AC_SYS_RESTARTABLE_SYSCALLS
 
 dnl Miscellaneous Bash tests
 if test "$ac_cv_func_lstat" = "no"; then
@@ -599,10 +597,6 @@ BASH_DUP2_CLOEXEC_CHECK
 BASH_PGRP_SYNC
 BASH_SIGNAL_CHECK
 
-if test "$ac_cv_sys_restartable_syscalls" = "no"; then
-BASH_SYS_RESTARTABLE_SYSCALLS
-fi
-
 dnl checking for the presence of certain library symbols
 BASH_SYS_ERRLIST
 BASH_SYS_SIGLIST
===================================================================
RCS file: subst.c,v
retrieving revision 2.5.0.10
retrieving revision 2.5.0.11
diff -pu -r2.5.0.10 -r2.5.0.11
--- subst.c     2001/05/07 17:56:34     2.5.0.10
+++ subst.c     2001/06/13 16:16:01     2.5.0.11
@@ -45,11 +45,6 @@
 #include "trap.h"
 #include "pathexp.h"
 #include "mailcheck.h"
-
-#if !defined (HAVE_RESTARTABLE_SYSCALLS)       /* for getc_with_restart */
-#include "input.h"
-#endif
-
 #include "builtins/getopt.h"
 #include "builtins/common.h"
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]