Skip to contentSkip to conversation

ts-host-ping-check: Properly append the ping output

PATCH In review Ian Jackson 2 participants 2 messages Oct 19, 2015 – Oct 20, 2015

lore
Share & tools
lore
#0 lore raw

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'.

---
 ts-host-ping-check |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ts-host-ping-check +1 -1
index ca8920c..f10e73c 100755
@@ -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