From 16c22751fa88229cb961cdf6bbc7c4d228b50ee9 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Mon, 7 Jun 2010 07:16:43 +0100 Subject: [PATCH] xenwatchdogd: Fix build errors Signed-off-by: Patrick Colp --- tools/misc/xenwatchdogd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/misc/xenwatchdogd.c b/tools/misc/xenwatchdogd.c index aa96834e5f..254117b554 100644 --- a/tools/misc/xenwatchdogd.c +++ b/tools/misc/xenwatchdogd.c @@ -28,9 +28,12 @@ void daemonize(void) err(1, "setsid"); if (chdir("/") < 0) err(1, "chdir /"); - freopen("/dev/null", "r", stdin); - freopen("/dev/null", "w", stdout); - freopen("/dev/null", "w", stderr); + if (freopen("/dev/null", "r", stdin) == NULL) + err(1, "reopen stdin"); + if(freopen("/dev/null", "w", stdout) == NULL) + err(1, "reopen stdout"); + if(freopen("/dev/null", "w", stderr) == NULL) + err(1, "reopen stderr"); } void catch_exit(int sig) -- 2.30.2