]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
rfkill: do not fsync(3) /dev/rfkill file descriptor
authorSami Kerola <kerolasa@iki.fi>
Mon, 11 Sep 2017 19:55:58 +0000 (20:55 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 15 Sep 2017 10:24:31 +0000 (12:24 +0200)
Attempt to fsync() this device returns EINVAL, causing the rfkill always to
return EXIT_FAILURE when either block or unblock is requested.  Simply
closing the file descriptor will fix the issue.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
sys-utils/rfkill.c

index 6b586d2ed3e1fb8cb195e1f188bb05b3cf87c779..7914c4309340c5b8a30e92064bfe620736d32e02 100644 (file)
@@ -452,7 +452,7 @@ static int rfkill_block(uint8_t block, const char *param)
                closelog();
        }
        free(message);
-       return close_fd(fd);
+       return close(fd);
 }
 
 static void __attribute__((__noreturn__)) usage(void)