chiark / gitweb /
Mirroring: Sort out stderr plumbing
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Jul 2015 16:40:26 +0000 (17:40 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Jul 2015 18:31:19 +0000 (19:31 +0100)
infra/dgit-mirror-rsync

index 2858047..0162042 100755 (executable)
@@ -105,13 +105,13 @@ lock-and-process () {
 }
 
 attempt () {
-       exec >"$queue/$package.err" 2>&1
+       exec 3>&2 >"$queue/$package.err" 2>&1
        if actually; then
                rm -f "$queue/$package.a"
                mv -f "$queue/$package.err" "$queue/$package.log"
                rm "$queue/$package.lock"
        else
-               cat >&2 "$queue/$package.err"
+               cat >&3 "$queue/$package.err"
                exit 127
        fi
 }