]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
ctrlaltdel: use new ul_path_* API
authorKarel Zak <kzak@redhat.com>
Thu, 17 May 2018 14:26:07 +0000 (16:26 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 21 Jun 2018 11:07:46 +0000 (13:07 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/ctrlaltdel.c

index 22814587f118c89e280a1d59f745eefc3f0fe5e3..ea662c4868f5ead0e24797fb701ca963e50ac618 100644 (file)
@@ -38,7 +38,10 @@ static void __attribute__((__noreturn__)) usage(void)
 
 static int get_cad(void)
 {
-       uint64_t val = path_read_u64(_PATH_PROC_CTRL_ALT_DEL);
+       uint64_t val;
+
+       if (ul_path_read_u64(NULL, &val, _PATH_PROC_CTRL_ALT_DEL) != 0)
+               err(EXIT_FAILURE, _("cannot read %s"), _PATH_PROC_CTRL_ALT_DEL);
 
        switch (val) {
        case 0: