]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Bug 362: be more informative if there is a problem with /dev/null
authorLee Howard <faxguy@howardsilvan.com>
Tue, 27 Sep 2005 19:03:11 +0000 (19:03 +0000)
committerLee Howard <faxguy@howardsilvan.com>
Tue, 27 Sep 2005 19:03:11 +0000 (19:03 +0000)
CHANGES
faxd/faxApp.c++
hfaxd/main.c++

diff --git a/CHANGES b/CHANGES
index ea1fd7953c38292423c3faa2d7936bf3018bf9e5..70a0c7e268cc986e1d18120744d390df73ca2698 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,7 @@
 
 Changelog for HylaFAX
 
+* be more informative with /dev/null errors (27 Sep 2005)
 * don't place a call if there are no documents (27 Sep 2005)
 * make hfaxd clean up after itself (27 Sep 2005)
 * add xferfaxlog accounting for jobs that time out (27 Sep 2005)
index da3ca367f7a438e456967477bb0a49a0ab9ef97c..87e161e75847388e99397d1dc5b6c80864bbd579 100644 (file)
@@ -357,6 +357,8 @@ detachIO(void)
     endpwent();                                // XXX some systems hold descriptors
     closelog();                                // XXX in case syslog has descriptor
     int fd = Sys::open(_PATH_DEVNULL, O_RDWR);
+    if (fd == -1)
+       printf("Could not open null device file %s.", _PATH_DEVNULL);
     dup2(fd, STDIN_FILENO);
     dup2(fd, STDOUT_FILENO);
     dup2(fd, STDERR_FILENO);
@@ -464,6 +466,8 @@ faxApp::detachFromTTY(void)
 {
 #ifdef O_NOCTTY
     int fd = Sys::open(_PATH_DEVNULL, O_RDWR);
+    if (fd == -1)
+       printf("Could not open null device file %s.", _PATH_DEVNULL);
     dup2(fd, STDIN_FILENO);
     dup2(fd, STDOUT_FILENO);
     dup2(fd, STDERR_FILENO);
index 27d2bb431093c34caf781429a6351a27ba6e0d28..42303a200a826b81b3a267b31401a1c299342296 100644 (file)
@@ -160,6 +160,8 @@ static void
 detachFromTTY(void)
 {
     int fd = Sys::open(_PATH_DEVNULL, O_RDWR);
+    if (fd == -1)
+       fatal("Could not open null device file %s.", _PATH_DEVNULL);
     dup2(fd, STDIN_FILENO);
     dup2(fd, STDOUT_FILENO);
     dup2(fd, STDERR_FILENO);