Skip to contentSkip to conversation

wdctl: do not call fsync(2) when closing watchdog device

PATCH Applied Sami Kerola 2 participants 2 messages Jul 23, 2017 – Jul 31, 2017 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wdctl: do not call fsync(2) when closing watchdog device

This removes bogus write failed warning.

$ wdctl
wdctl: write failed: Invalid argument
Device:        /dev/watchdog
[...]
---
 sys-utils/wdctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sys-utils/wdctl.c +2 -2
index 33012dca3..642db85d2 100644
@@ -343,7 +343,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",
@@ -408,7 +408,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);
 
Signature · 1 line
2.13.3
maintainer Applied
#1 lore raw
Quoted 2 lines · Sami Kerola
 sys-utils/wdctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com