Skip to content

Commit 125a2df

Browse files
elderingvmcj
authored andcommitted
Correctly handle unshare call error status
Thanks Keyu Tao for reporting. (cherry picked from commit 19909c4)
1 parent 082c0bb commit 125a2df

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: judge/runguard.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,9 @@ int main(int argc, char **argv)
11981198

11991199
cgroup_create();
12001200

1201-
unshare(CLONE_FILES|CLONE_FS|CLONE_NEWIPC|CLONE_NEWNET|CLONE_NEWNS|CLONE_NEWUTS|CLONE_SYSVSEM);
1201+
if ( unshare(CLONE_FILES|CLONE_FS|CLONE_NEWIPC|CLONE_NEWNET|CLONE_NEWNS|CLONE_NEWUTS|CLONE_SYSVSEM)!=0 ) {
1202+
error(errno, "calling unshare");
1203+
}
12021204

12031205
/* Check if any Linux Out-Of-Memory killer adjustments have to
12041206
* be made. The oom_adj or oom_score_adj is inherited by child

0 commit comments

Comments
 (0)