]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
wdctl: do not call fsync(2) when closing watchdog device
authorSami Kerola <kerolasa@iki.fi>
Sun, 23 Jul 2017 21:20:37 +0000 (22:20 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 20 Sep 2017 12:12:29 +0000 (14:12 +0200)
This removes bogus write failed warning.

$ wdctl
wdctl: write failed: Invalid argument
Device:        /dev/watchdog
[...]

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

index e47fc70e989404260dbd68b112c52b8dcf582831..483189de49b06567a66a5c2fccbbdd5ccb8773a0 100644 (file)
@@ -344,7 +344,7 @@ static int set_watchdog(struct wdinfo *wd, int timeout)
                warn(_("cannot set timeout for %s"), wd->device);
        }
 
-       if (close_fd(fd))
+       if (close(fd))
                warn(_("write failed"));
        sigprocmask(SIG_SETMASK, &oldsigs, NULL);
        printf(P_("Timeout has been set to %d second.\n",
@@ -409,7 +409,7 @@ static int read_watchdog(struct wdinfo *wd)
                 * the machine might end up rebooting. */
        }
 
-       if (close_fd(fd))
+       if (close(fd))
                warn(_("write failed"));
        sigprocmask(SIG_SETMASK, &oldsigs, NULL);