1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-13 15:13:23 +00:00

Corrections for Ubuntu-24 with newer compilers

This commit is contained in:
Gerhard 2025-02-10 12:46:57 +01:00
parent 676888e8cc
commit 63f67101f4
5 changed files with 27 additions and 17 deletions

26
test.sh
View file

@ -15787,25 +15787,33 @@ te="$td/test$N.stderr"
tdiff="$td/test$N.diff"
da="test$N $(date) $RANDOM"
CMD0="$TRACE $SOCAT $opts STDIO SYSTEM:'tee /dev/stdout 2>/dev/null',pty,cfmakeraw"
#set -vx
printf "test $F_n $TEST... " $N
{ echo "$da"; relsleep 10; } |eval "$CMD0" >"${tf}0" 2>"${te}0" &
pid0=$!
relsleep 2
TTY=$(tty |sed 's|/dev/||')
pkill -USR1 -t $TTY socat || { echo "pkill -t $TTY -USR1 socat"; }
CMD1="pkill -USR1 -t $TTY socat"
printf "test $F_n $TEST... " $N
# On Fedora-41 pkill can be slow (eg.20ms)
{ echo "$da"; relsleep 20; } |eval "$CMD0" >"${tf}0" 2>"${te}0" &
pid0=$!
#date +'%Y-%m-%dT%H:%M:%S.%N' >>"${te}1"
relsleep 2
pkill -t $TTY socat
#date +'%Y-%m-%dT%H:%M:%S.%N' >>"${te}1"
$CMD1 2>"${te}1"
relsleep 2
#date +'%Y-%m-%dT%H:%M:%S.%N' >>"${te}1"
wait
pkill -t $TTY socat >>"${te}1"
if [ "$(grep STATISTICS "${te}0" |wc -l)" -eq 2 ]; then
$PRINTF "$OK\n"
if [ "$VERBOSE" ]; then echo "$CMD0"; fi
if [ "$VERBOSE" ]; then echo "$CMD0 &"; fi
if [ "$DEBUG" ]; then cat "${te}0" >&2; fi
if [ "$VERBOSE" ]; then echo "$CMD1"; fi
if [ "$DEBUG" ]; then cat "${te}1" >&2; fi
ok
else
$PRINTF "$FAILED\n"
$PRINTF "$FAILED (no stats)\n"
echo "$CMD0 &"
cat "${te}0" >&2
echo "$CMD1"
cat "${te}1" >&2
failed
fi
fi # NUMCOND