Don't log to stderr if logfile cannot be opened.
Removes problem with make-logfile-rotator and closing stderr.
This commit is contained in:
+4
-3
@@ -114,6 +114,8 @@
|
||||
(force-output (http-log-port))
|
||||
(release-lock http-log-lock)))))
|
||||
|
||||
|
||||
;; does the logfile rotation on signal USR1
|
||||
(define (make-logfile-rotator logfile http-log-lock)
|
||||
(set-interrupt-handler interrupt/usr1 #f)
|
||||
(lambda ()
|
||||
@@ -129,11 +131,10 @@
|
||||
(with-errno-handler*
|
||||
(lambda (errno packet)
|
||||
(format (current-error-port)
|
||||
"[httpd] Warning: An error occured while opening ~S for writing (~A).
|
||||
Logging now to stderr.~%"
|
||||
"[httpd] Warning: An error occured while opening ~S for writing (~A).~%Send signal USR1 when the problem is fixed.~%"
|
||||
logfile
|
||||
(car packet))
|
||||
(current-error-port))
|
||||
(make-null-output-port))
|
||||
(lambda ()
|
||||
(open-output-file logfile
|
||||
(bitwise-ior open/create open/append)))))
|
||||
|
||||
Reference in New Issue
Block a user