Skip to content

Commit 5fc4be6

Browse files
elderingmeisterT
authored andcommitted
Exclude pre/suffix / from cgroupname for clarity
1 parent 68438a6 commit 5fc4be6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

judge/runguard.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ void output_exit_time(int exitcode, double cpudiff)
442442
void check_remaining_procs()
443443
{
444444
char path[1024];
445-
snprintf(path, 1023, "/sys/fs/cgroup/cpuacct%scgroup.procs", cgroupname);
445+
snprintf(path, 1023, "/sys/fs/cgroup/cpuacct/%s/cgroup.procs", cgroupname);
446446

447447
FILE *file = fopen(path, "r");
448448
if (file == nullptr) {
@@ -1184,7 +1184,7 @@ int main(int argc, char **argv)
11841184
} else {
11851185
str[0] = 0;
11861186
}
1187-
snprintf(cgroupname, 255, "/domjudge/dj_cgroup_%d_%.16s_%d.%06d/",
1187+
snprintf(cgroupname, 255, "domjudge/dj_cgroup_%d_%.16s_%d.%06d",
11881188
getpid(), str, (int)progstarttime.tv_sec, (int)progstarttime.tv_usec);
11891189

11901190
cgroup_create();

0 commit comments

Comments
 (0)