bug-coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] Replacement for the sigs_to_ignore hack in timeout.c


From: Eric Blake
Subject: Re: [PATCH] Replacement for the sigs_to_ignore hack in timeout.c
Date: Fri, 10 Oct 2008 06:29:38 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.17) Gecko/20080914 Thunderbird/2.0.0.17 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Giuseppe Scrivano on 10/6/2008 3:33 PM:
> +  sigaction (sig, NULL, &sa);
> +  handler = sa.sa_handler;
> +  sa.sa_handler = SIG_IGN;

This is not necessarily safe, if SA_SIGINFO is set (sa.handler and
sa_siginfo are not required to occupy the same memory, but SIG_IGN is only
assignable to sa_handler).  On the other hand, timeout is not using
SA_SIGINFO, so this really doesn't matter here.

On the other hand, POSIX is explicit that mixing signal and sigaction is
not portable.  For that matter, now that gnulib provides a guaranteed
sigaction, why don't we just change all of coreutils to use it?  Affected
are: csplit, dd, install, ls, nohup, sort, tee, and timeout.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkjvSrIACgkQ84KuGfSFAYDQkgCgg1w+gJyScyYjOTS0XhyZqHkZ
yxoAniidRPATY0WS0N9zlY5e8uc46ZrD
=R5c5
-----END PGP SIGNATURE-----




reply via email to

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