Skip to content

Commit d348000

Browse files
committed
linux: fix check for oom_score_adj
do not write to the oom_score_adj only when the oom_score_adj value is not present in the spec file. Signed-off-by: Giuseppe Scrivano <[email protected]>
1 parent 3dc4ce9 commit d348000

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcrun/linux.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3176,7 +3176,7 @@ libcrun_set_oom (libcrun_container_t *container, libcrun_error_t *err)
31763176
cleanup_close int fd = -1;
31773177
int ret;
31783178
char oom_buffer[16];
3179-
if (def->process == NULL || def->process->oom_score_adj == 0)
3179+
if (def->process == NULL || ! def->process->oom_score_adj_present)
31803180
return 0;
31813181
sprintf (oom_buffer, "%i", def->process->oom_score_adj);
31823182
fd = open ("/proc/self/oom_score_adj", O_RDWR);

0 commit comments

Comments
 (0)