178
178
# ############################################################################
179
179
# Log output of a command to a file
180
180
# ############################################################################
181
+
182
+ pipelog () {
183
+ $TEE -a $LOGFILE 2>&1
184
+ }
185
+
181
186
logcmd () {
182
187
typeset preserve_stdout=0
183
188
[ " $1 " = " -p" ] && shift && preserve_stdout=1
@@ -191,18 +196,14 @@ logcmd() {
191
196
else
192
197
if [ " $preserve_stdout " = 0 ]; then
193
198
echo Running: " $@ "
194
- " $@ " | $TEE -a $LOGFILE 2>&1
199
+ " $@ " | pipelog
195
200
return ${PIPESTATUS[0]}
196
201
else
197
202
" $@ "
198
203
fi
199
204
fi
200
205
}
201
206
202
- pipelog () {
203
- $TEE -a $LOGFILE 2>&1
204
- }
205
-
206
207
c_highlight=" ` $TPUT setaf 2` "
207
208
c_error=" ` $TPUT setaf 1` "
208
209
c_note=" ` $TPUT setaf 6` "
@@ -3596,7 +3597,7 @@ check_rtime() {
3596
3597
-f $TMPDIR /rtime.files
3597
3598
3598
3599
if [ -s " $TMPDIR /rtime.err" ]; then
3599
- $CAT $TMPDIR /rtime.err | $TEE -a $LOGFILE
3600
+ $CAT $TMPDIR /rtime.err | pipelog
3600
3601
logerr " ELF runtime problems detected"
3601
3602
fi
3602
3603
}
@@ -3614,7 +3615,7 @@ check_ssp() {
3614
3615
done < <( rtime_objects)
3615
3616
wait
3616
3617
if [ -s " $TMPDIR /rtime.ssp" ]; then
3617
- $CAT $TMPDIR /rtime.ssp | $TEE -a $LOGFILE
3618
+ $CAT $TMPDIR /rtime.ssp | pipelog
3618
3619
logerr " Found object(s) without SSP"
3619
3620
fi
3620
3621
}
@@ -3653,7 +3654,7 @@ check_soname() {
3653
3654
done < <( rtime_objects -f)
3654
3655
wait
3655
3656
if [ -s " $TMPDIR /rtime.soname" ]; then
3656
- $CAT $TMPDIR /rtime.soname | $TEE -a $LOGFILE
3657
+ $CAT $TMPDIR /rtime.soname | pipelog
3657
3658
logerr " Found SONAME problems"
3658
3659
fi
3659
3660
}
@@ -3678,7 +3679,7 @@ check_bmi() {
3678
3679
done < <( rtime_objects)
3679
3680
wait
3680
3681
if [ -s " $TMPDIR /rtime.bmi" ]; then
3681
- $CAT $TMPDIR /rtime.bmi | $TEE -a $LOGFILE
3682
+ $CAT $TMPDIR /rtime.bmi | pipelog
3682
3683
logerr " BMI instruction set found"
3683
3684
fi
3684
3685
}
0 commit comments