Skip to content

Commit

Permalink
bug fix to posix_spawn to avoid trying to set IRIX internal signal 65…
Browse files Browse the repository at this point in the history
… - which posix_spawn attempts to include in sigaction
  • Loading branch information
danielhams committed Sep 5, 2020
1 parent d03d884 commit 4694982
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion libdicl/configure.ac
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AC_PREREQ(2.65)
AC_INIT([libdicl],
[0.1.32],
[0.1.33],
[[email protected]])

AC_SUBST(ACLOCAL_AMFLAGS, "-I macros")
Expand Down
20 changes: 17 additions & 3 deletions libdicl/gl/spawni.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

}

Expand Down
19 changes: 7 additions & 12 deletions libdicl/gnulibimportnotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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

0 comments on commit 4694982

Please sign in to comment.