ts-host-ping-check: Properly append the ping output
PATCH 1/1 ts-host-ping-check: Properly append the ping output
On Linux opening /dev/stderr produces a non-O_APPEND open-file, with its own file position pointer, even if stderr was opened O_APPEND.
As a result the logfile from this step would be mangled. So use `tee -a'.
Signed-off-by Ian Jackson <[email protected]>
--- ts-host-ping-check | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ts-host-ping-check +1 -1
@@ -28,7 +28,7 @@ our $ho= selecthost($whhost); exit 0 if $ho->{SharedReady}; -$_ = `ping -D -i 0.2 -c 100 $ho->{Ip} | tee /dev/stderr`; +$_ = `ping -D -i 0.2 -c 100 $ho->{Ip} | tee -a /dev/stderr`; m/\b([0-9.]+)% packet loss\b/ or die "$_ ?";
Signature · 1 line
1.7.10.4
Quoted 7 lines · Ian Jackson
On Linux opening
/dev/stderrproduces a non-O_APPEND open-file, with its own file position pointer, even if stderr was openedO_APPEND.As a result the logfile from this step would be mangled. So use `tee -a'.
Signed-off-by Ian Jackson <[email protected]>
Acked-by Ian Campbell <[email protected]>