]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Handle errors in JobControl better
authorAidan Van Dyk <aidan@ifax.com>
Mon, 23 Jul 2007 21:04:34 +0000 (21:04 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Mon, 23 Jul 2007 21:04:34 +0000 (21:04 +0000)
We need to handle the errors in pipe/fork for JobControl in a way that doesn't
cause ctrlJobDone() to be called.  If it's called directly, it tries to log the
qfile (which is already locked) and causes problems.

faxd/faxQueueApp.c++

index a27256de4e9158031c8f8be94dbce4cd6d496c84..ced525725ed270ff0dfc5f41392a9fda405c933d 100644 (file)
@@ -1767,9 +1767,9 @@ faxQueueApp::setReadyToRun(Job& job, FaxRequest& req)
            case -1:                    // error - continue with no JCI
                jobError(job, "JOB CONTROL: fork: %m");
                Sys::close(pfd[1]);
-                // When fork fails we need to run jobCtrlDone, since there
+                // When fork fails we need to set it ready, because there
                 // will be no child signal to start it.
-                ctrlJobDone(job, -1);
+                setReady(job, req);
                break;
            case 0:                             // child, exec command
                if (pfd[1] != STDOUT_FILENO)
@@ -1788,9 +1788,10 @@ faxQueueApp::setReadyToRun(Job& job, FaxRequest& req)
            }
        } else
        {
+           jobError(job, "JOB CONTROL: pipe failed: %m");
            // If our pipe fails, we can't run the child, but we still
-           // Need jobCtrlDone to be called to proceed this job
-           ctrlJobDone(job, -1);
+           // Need setReady to be called to proceed this job
+           setReady(job, req);
        }
     } else
        setReady(job, req);