From: Keir Fraser Date: Mon, 7 Jun 2010 06:16:43 +0000 (+0100) Subject: xenwatchdogd: Fix build errors X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~12003 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=16c22751fa88229cb961cdf6bbc7c4d228b50ee9;p=xen.git xenwatchdogd: Fix build errors Signed-off-by: Patrick Colp --- 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)