diff options
Diffstat (limited to 'sandbox/linux/suid/process_util_linux.c')
-rw-r--r-- | sandbox/linux/suid/process_util_linux.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sandbox/linux/suid/process_util_linux.c b/sandbox/linux/suid/process_util_linux.c index 4a574ad..9f40f39 100644 --- a/sandbox/linux/suid/process_util_linux.c +++ b/sandbox/linux/suid/process_util_linux.c @@ -8,6 +8,7 @@ #include "process_util.h" #include <fcntl.h> +#include <inttypes.h> #include <limits.h> #include <stdio.h> #include <stdlib.h> @@ -20,9 +21,9 @@ bool AdjustOOMScore(pid_t process, int score) { if (score < 0 || score > 15) return false; - char oom_adj[35]; // "/proc/" + log_2(2**64) + "/oom_adj\0" + char oom_adj[35]; // "/proc/" + log_10(2**64) + "/oom_adj\0" // 6 + 20 + 9 = 35 - snprintf(oom_adj, sizeof(oom_adj), "/proc/%lu", process); + snprintf(oom_adj, sizeof(oom_adj), "/proc/%" PRIdMAX, (intmax_t)process); struct stat statbuf; if (stat(oom_adj, &statbuf) < 0) |