Date: Wed, 11 Nov 2009 23:13:24 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r199205 - head/bin/sh Message-ID: <200911112313.nABNDOGZ010520@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jilles Date: Wed Nov 11 23:13:24 2009 New Revision: 199205 URL: http://svn.freebsd.org/changeset/base/199205 Log: sh: Use sigaction instead of signal/siginterrupt combination. Modified: head/bin/sh/trap.c Modified: head/bin/sh/trap.c ============================================================================== --- head/bin/sh/trap.c Wed Nov 11 22:37:17 2009 (r199204) +++ head/bin/sh/trap.c Wed Nov 11 23:13:24 2009 (r199205) @@ -244,7 +244,8 @@ void setsignal(int signo) { int action; - sig_t sig, sigact = SIG_DFL; + sig_t sigact = SIG_DFL; + struct sigaction sa; char *t; if ((t = trap[signo]) == NULL) @@ -320,9 +321,10 @@ setsignal(int signo) case S_IGN: sigact = SIG_IGN; break; } *t = action; - sig = signal(signo, sigact); - if (sig != SIG_ERR && action == S_CATCH) - siginterrupt(signo, 1); + sa.sa_handler = sigact; + sa.sa_flags = 0; + sigemptyset(&sa.sa_mask); + sigaction(signo, &sa, NULL); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911112313.nABNDOGZ010520>