]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
rfkill: don't use lib/path
authorKarel Zak <kzak@redhat.com>
Thu, 17 May 2018 14:05:39 +0000 (16:05 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 21 Jun 2018 11:07:46 +0000 (13:07 +0200)
It seems like crazy overkill for this trivial purpose.

Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/rfkill.c

index d87815a25846ef56e43840a87488981cdc2625d1..a93e8ba83fb3bd9871c691f1b3a77393fff7d16b 100644 (file)
@@ -37,7 +37,6 @@
 #include "timeutils.h"
 #include "widechar.h"
 #include "xalloc.h"
-#include "path.h"
 
 
 /*
@@ -274,9 +273,12 @@ failed:
 static const char *get_sys_attr(uint32_t idx, const char *attr)
 {
        static char name[128];
-       FILE *f = path_fopen("r", 0, _PATH_SYS_RFKILL "/rfkill%u/%s", idx, attr);
+       char path[PATH_MAX];
+       FILE *f;
        char *p;
 
+       snprintf(path, sizeof(path), _PATH_SYS_RFKILL "/rfkill%u/%s", idx, attr);
+       f = fopen(path, "r");
        if (!f)
                goto done;
        if (!fgets(name, sizeof(name), f))