Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jan 2017 08:25:31 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r311268 - head/contrib/netbsd-tests/lib/libc/sys
Message-ID:  <201701040825.v048PVPg078611@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Wed Jan  4 08:25:31 2017
New Revision: 311268
URL: https://svnweb.freebsd.org/changeset/base/311268

Log:
  Clarify lifetime of child(..) function
  
  Ensure child exits when complete as it's always run in a forked
  process.
  
  Add a missing break statement in :pselect_sigmask when calling
  child(..) for clarity and to avoid weird domino effects if the
  child process somehow does something it's not supposed to do
  with the logfiles, file descriptors, etc
  
  MFC after:	1 week
  Reported by:	Coverity
  CID:		1223369, 1223370, 1300301

Modified:
  head/contrib/netbsd-tests/lib/libc/sys/t_select.c

Modified: head/contrib/netbsd-tests/lib/libc/sys/t_select.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/sys/t_select.c	Wed Jan  4 08:12:31 2017	(r311267)
+++ head/contrib/netbsd-tests/lib/libc/sys/t_select.c	Wed Jan  4 08:25:31 2017	(r311268)
@@ -135,6 +135,9 @@ child(const struct timespec *ts)
 		    "after timeout %s != %s",
 		    prmask(&nset, nbuf, sizeof(nbuf)),
 		    prmask(&oset, obuf, sizeof(obuf)));
+#ifdef	__FreeBSD__
+	_exit(0);
+#endif
 }
 
 ATF_TC(pselect_sigmask);
@@ -154,6 +157,9 @@ ATF_TC_BODY(pselect_sigmask, tc)
 	switch (pid = fork()) {
 	case 0:
 		child(NULL);
+#ifdef	__FreeBSD__
+		break;
+#endif
 	case -1:
 		err(1, "fork");
 	default:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701040825.v048PVPg078611>