Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Nov 2014 05:05:19 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r274571 - head/contrib/netbsd-tests/lib/libpthread
Message-ID:  <201411160505.sAG55JRP055205@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Sun Nov 16 05:05:18 2014
New Revision: 274571
URL: https://svnweb.freebsd.org/changeset/base/274571

Log:
  Use _exit instead of exit so the file descriptors aren't flushed twice in the
  child processes
  
  Submitted by: pho

Modified:
  head/contrib/netbsd-tests/lib/libpthread/t_fork.c

Modified: head/contrib/netbsd-tests/lib/libpthread/t_fork.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libpthread/t_fork.c	Sun Nov 16 04:13:44 2014	(r274570)
+++ head/contrib/netbsd-tests/lib/libpthread/t_fork.c	Sun Nov 16 05:05:18 2014	(r274571)
@@ -61,7 +61,11 @@ print_pid(void *arg)
 
 	thread_survived = 1;
 	if (parent != getpid()) {
+#ifdef __FreeBSD__
+		_exit(1);
+#else
 		exit(1);
+#endif
 	}
 	return NULL;
 }
@@ -95,7 +99,11 @@ ATF_TC_BODY(fork, tc)
 		ATF_REQUIRE_EQ_MSG(WEXITSTATUS(status), 0, "thread survived in child");
 	} else {
 		sleep(5);
+#ifdef __FreeBSD__
+		_exit(thread_survived ? 1 : 0);
+#else
 		exit(thread_survived ? 1 : 0);
+#endif
 	}
 }
 



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