summaryrefslogtreecommitdiffstats
path: root/sys-utils/choom.c
diff options
context:
space:
mode:
authorKarel Zak2018-12-10 14:26:04 +0100
committerKarel Zak2018-12-10 14:26:04 +0100
commitc455cdb30d212b6488d3e9f2f663fcc1f6ad267c (patch)
tree95093d9c30cc3e113fd3e27c035f12c4b2ee1d4c /sys-utils/choom.c
parentlibuuid: fix man page typos (diff)
downloadkernel-qcow2-util-linux-c455cdb30d212b6488d3e9f2f663fcc1f6ad267c.tar.gz
kernel-qcow2-util-linux-c455cdb30d212b6488d3e9f2f663fcc1f6ad267c.tar.xz
kernel-qcow2-util-linux-c455cdb30d212b6488d3e9f2f663fcc1f6ad267c.zip
choom: fix negative adjust score usage
It's really bad idea to use uint64_t (ul_path_write_u64(()) when write signed number. Addresses: https://github.com/karelzak/util-linux/issues/723 Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/choom.c')
-rw-r--r--sys-utils/choom.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys-utils/choom.c b/sys-utils/choom.c
index 6895aef43..eff95b6bf 100644
--- a/sys-utils/choom.c
+++ b/sys-utils/choom.c
@@ -74,7 +74,7 @@ static int get_score_adj(struct path_cxt *pc)
static int set_score_adj(struct path_cxt *pc, int adj)
{
- return ul_path_write_u64(pc, adj, "oom_score_adj");
+ return ul_path_write_s64(pc, adj, "oom_score_adj");
}
int main(int argc, char **argv)