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