fix: sync-music: use unwind-protect in with-ignore-stderr

This commit is contained in:
eriedaberrie 2024-11-11 19:57:16 -08:00
parent c9779f83cf
commit cea9a46872

View file

@ -20,10 +20,9 @@ Only works on Unix systems with a /dev/fd/ filesystem."
`(progn `(progn
(finish-output *error-output*) (finish-output *error-output*)
(let ((,old-stderr (dup +stderr-fileno+))) (let ((,old-stderr (dup +stderr-fileno+)))
(prog1
(progn
(freopen "/dev/null" "w" +stderr+) (freopen "/dev/null" "w" +stderr+)
,@body) (unwind-protect
(progn ,@body)
(freopen (format nil "/dev/fd/~D" ,old-stderr) "a" +stderr+))))) (freopen (format nil "/dev/fd/~D" ,old-stderr) "a" +stderr+)))))
#-unix #-unix
`(progn ,@body)) `(progn ,@body))