about summary refs log tree commit diff
path: root/src/process/posix_spawn.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/process/posix_spawn.c')
-rw-r--r--src/process/posix_spawn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/process/posix_spawn.c b/src/process/posix_spawn.c
index c3e800b8..5eb516b0 100644
--- a/src/process/posix_spawn.c
+++ b/src/process/posix_spawn.c
@@ -35,9 +35,9 @@ int __posix_spawnx(pid_t *restrict res, const char *restrict path,
 
 	__acquire_ptc();
 	pid = __vfork();
-	__release_ptc();
 
 	if (pid) {
+		__release_ptc();
 		sigprocmask(SIG_SETMASK, &oldmask, 0);
 		if (pid < 0) return -pid;
 		*res = pid;