]> xenbits.xensource.com Git - xen.git/commitdiff
xenwatchdogd: Fix build errors
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 7 Jun 2010 06:16:43 +0000 (07:16 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 7 Jun 2010 06:16:43 +0000 (07:16 +0100)
Signed-off-by: Patrick Colp <pjcolp@cs.ubc.ca>
tools/misc/xenwatchdogd.c

index aa96834e5fa40eb7e914464a1900d02be0be55d0..254117b554c59196cae120ab0a0505d15d5a704b 100644 (file)
@@ -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)