Date: Wed, 13 Jun 2012 03:41:42 +0000 (UTC) From: Eitan Adler <eadler@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r236986 - stable/7/usr.bin/mail Message-ID: <201206130341.q5D3fgIB093336@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: eadler Date: Wed Jun 13 03:41:42 2012 New Revision: 236986 URL: http://svn.freebsd.org/changeset/base/236986 Log: MFC r236286: Fix likely race condition if wait_child() is interrupted by sigchild() PR: bin/102834 Approved by: cperciva (implicit) Modified: stable/7/usr.bin/mail/popen.c Directory Properties: stable/7/usr.bin/mail/ (props changed) Modified: stable/7/usr.bin/mail/popen.c ============================================================================== --- stable/7/usr.bin/mail/popen.c Wed Jun 13 03:41:22 2012 (r236985) +++ stable/7/usr.bin/mail/popen.c Wed Jun 13 03:41:42 2012 (r236986) @@ -364,12 +364,14 @@ wait_child(pid) int pid; { sigset_t nset, oset; - struct child *cp = findchild(pid); + struct child *cp; (void)sigemptyset(&nset); (void)sigaddset(&nset, SIGCHLD); (void)sigprocmask(SIG_BLOCK, &nset, &oset); + cp = findchild(pid); + while (!cp->done) (void)sigsuspend(&oset); wait_status = cp->status;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206130341.q5D3fgIB093336>