From 5079904b440139c731e3d79fc39c802748ae9448 Mon Sep 17 00:00:00 2001 From: Darren Mo Date: Thu, 5 Feb 2015 09:56:04 -0800 Subject: [PATCH] Subprocess Process Group Improvements Summary: Eliminated a potential race condition by removing unnecessary code. Test Plan: Unit tests pass. Reviewed By: lesha@fb.com Subscribers: tudorb, trunkagent, folly-diffs@, yfeldblum FB internal diff: D1824924 Signature: t1:1824924:1423102017:6bce388dccf9126d6ac3a1741d8300a51c5276ed Blame Revision: D1492526 --- folly/Subprocess.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/folly/Subprocess.cpp b/folly/Subprocess.cpp index 8de5d369..d9b21cff 100644 --- a/folly/Subprocess.cpp +++ b/folly/Subprocess.cpp @@ -289,14 +289,6 @@ void Subprocess::spawn( // child has exited and can be immediately waited for. In all other cases, // we have no way of cleaning up the child. - if (options.processGroupLeader_) { - // This is done both in the parent and the child to avoid the race where - // the parent assumes that the child is a leader, but the child has not - // yet run setprp(). Not checking error codes since we're deliberately - // racing the child, which may already have run execve(), and expect to - // lose frequently. - setpgid(pid_, pid_); - } // Close writable side of the errFd pipe in the parent process CHECK_ERR(::close(errFds[1])); errFds[1] = -1; -- 2.34.1