From: Sami Kerola Date: Mon, 11 Sep 2017 19:55:58 +0000 (+0100) Subject: rfkill: do not fsync(3) /dev/rfkill file descriptor X-Git-Tag: v2.31-rc1~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b120966812809c816a184f21bf10c65ed837bf49;p=thirdparty%2Futil-linux.git rfkill: do not fsync(3) /dev/rfkill file descriptor 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 --- diff --git a/sys-utils/rfkill.c b/sys-utils/rfkill.c index 6b586d2ed3..7914c43093 100644 --- a/sys-utils/rfkill.c +++ b/sys-utils/rfkill.c @@ -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)