aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/linux_common.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-06-29 11:45:59 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-06-29 11:45:59 +0200
commit346edcb763a5aa4b82dd5ec59e214a801897c586 (patch)
tree7472b213ebe4950a63af9379a75712e026c5b51f /pkg/csource/linux_common.go
parent5adb8b743748862138016b833427f54fc9555943 (diff)
executor: fix pid check after fork
Diffstat (limited to 'pkg/csource/linux_common.go')
-rw-r--r--pkg/csource/linux_common.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/csource/linux_common.go b/pkg/csource/linux_common.go
index 2ab93fcfe..c1313c018 100644
--- a/pkg/csource/linux_common.go
+++ b/pkg/csource/linux_common.go
@@ -2251,7 +2251,7 @@ static int do_sandbox_none(void)
debug("unshare(CLONE_NEWPID): %d\n", errno);
}
int pid = fork();
- if (pid <= 0)
+ if (pid != 0)
return wait_for_loop(pid);
#if defined(SYZ_EXECUTOR) || defined(SYZ_ENABLE_CGROUPS)
@@ -2279,7 +2279,7 @@ static int do_sandbox_setuid(void)
if (unshare(CLONE_NEWPID))
fail("unshare(CLONE_NEWPID)");
int pid = fork();
- if (pid <= 0)
+ if (pid != 0)
return wait_for_loop(pid);
#if defined(SYZ_EXECUTOR) || defined(SYZ_ENABLE_CGROUPS)