From 469498291071a9cce82fce890576259e4474b2b0 Mon Sep 17 00:00:00 2001 From: Daniel Hams Date: Sat, 5 Sep 2020 09:38:12 +0100 Subject: [PATCH] bug fix to posix_spawn to avoid trying to set IRIX internal signal 65 - which posix_spawn attempts to include in sigaction --- libdicl/configure.ac | 2 +- libdicl/gl/spawni.c | 20 +++++++++++++++++--- libdicl/gnulibimportnotes.txt | 19 +++++++------------ 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/libdicl/configure.ac b/libdicl/configure.ac index a1b6fb5..2349978 100644 --- a/libdicl/configure.ac +++ b/libdicl/configure.ac @@ -1,6 +1,6 @@ AC_PREREQ(2.65) AC_INIT([libdicl], - [0.1.32], + [0.1.33], [daniel.hams@gmail.com]) AC_SUBST(ACLOCAL_AMFLAGS, "-I macros") diff --git a/libdicl/gl/spawni.c b/libdicl/gl/spawni.c index 087f45c..36d797d 100644 --- a/libdicl/gl/spawni.c +++ b/libdicl/gl/spawni.c @@ -199,10 +199,24 @@ __spawni (pid_t *pid, const char *file, memset (&sa, '\0', sizeof (sa)); sa.sa_handler = SIG_DFL; - for (sig = 1; sig <= NSIG; ++sig) - if (sigismember (&attrp->_sd, sig) != 0 - && sigaction (sig, &sa, NULL) != 0) + for (sig = 1; sig <= NSIG; ++sig) { +#if defined(__sgi) + switch( sig ) + { + // These signals aren't valid on irix + case 65: + { + continue; + } + default: + { + } + } +#endif + if (sigismember (&attrp->_sd, sig) != 0 && sigaction (sig, &sa, NULL) != 0) { _exit (SPAWN_ERROR); + } + } } diff --git a/libdicl/gnulibimportnotes.txt b/libdicl/gnulibimportnotes.txt index c371b0a..f517ae2 100755 --- a/libdicl/gnulibimportnotes.txt +++ b/libdicl/gnulibimportnotes.txt @@ -2,18 +2,13 @@ #$GNULIB_HOME/gnulib-tool --list -#$GNULIB_HOME/gnulib-tool --no-vc-files --source-base=gl --m4-base=gl/m4 --with-tests --import printf-posix vfprintf-posix vsprintf-posix wait-process - -#(order is important above!) - -# After the import, must set AM_CFLAGS= -fPIC -DPIC to create relocatable code -# Plus be _really_ careful about just over-committing - some of the existing -# gnulib code may well be edited (e.g. printf) -# -# After running this: -# (1) Put back the -fPIC -DPIC in gl/Makefile.am -# (2) git checkout gl/printf-parse.c gl/vasnprintf.c tests/test-gettimeofday.c tests/test-sys_time.c +# You can re-run this file when the GNULIB_HOME var is set to something +# sensible to re-import the gnulib stubs/implementations. +# This script _must_ put be used, as there are a few customisations +# require to make some of this code work on IRIX. +# Check the post import things below, where we restore +# any tweaks from git $GNULIB_HOME/gnulib-tool --import --lib=libgnu --source-base=gl \ --m4-base=/gl/m4 --doc-base=doc --tests-base=tests --aux-dir=. \ --with-tests --no-conditional-dependencies --no-libtool \ @@ -54,4 +49,4 @@ $GNULIB_HOME/gnulib-tool --import --lib=libgnu --source-base=gl \ wait-process perl -pi -e "s|AM_CFLAGS =|AM_CFLAGS = -fPIC -DPIC|g" gl/Makefile.am -git checkout gl/printf-parse.c gl/vasnprintf.c tests/test-gettimeofday.c tests/test-sys_time.c +git checkout gl/printf-parse.c gl/vasnprintf.c gl/spawni.c tests/test-gettimeofday.c tests/test-sys_time.c