off_t may be long long; more corrections for non Linux; configure.ac

This commit is contained in:
Gerhard Rieger 2015-04-03 17:55:37 +02:00
parent 6361eec4e9
commit 2dfd7ffcfb
8 changed files with 18 additions and 10 deletions

View file

@ -249,6 +249,10 @@ corrections:
Dual type addresses terminated when they were idle for EOF timeout time
off_t may be long long
more corrections for non Linux
configure.ac
porting:
Red Hat issue 1020203: configure checks fail with some compilers.
Use case: clang

View file

@ -162,7 +162,7 @@ socat.tar.bz2: socat.tar
VERSION = `sed 's/"//g' VERSION`
TARDIR = socat-$(VERSION)
socat.tar: configure.in configure Makefile.in config.h.in install-sh VERSION $(CFILES) $(HFILES) $(DOCFILES) $(SHFILES) $(OSFILES) $(TESTFILES) \
confiugre.ac
configure.ac
if [ ! -d $(TARDIR) ]; then mkdir $(TARDIR); fi
tar cf - $+ |(cd $(TARDIR); tar xf -)
tar cvf socat.tar $(TARDIR)

View file

@ -288,6 +288,8 @@ typedef int sig_atomic_t;
# define F_off "%""d"
# elif HAVE_BASIC_OFF_T==5
# define F_off "%ld"
# elif HAVE_BASIC_OFF_T==7
# define F_off "%Ld"
# else
#error "HAVE_BASIC_OFF_T is out of range:" HAVE_BASIC_OFF_T
# endif
@ -344,7 +346,7 @@ typedef int sig_atomic_t;
# elif HAVE_BASIC_DEV_T==8
#define F_dev "%Lu"
# else
#error "HAVE_TYPEOF_ST_DEV is out of range:" HAVE_TYPEOF_ST_DEV
#error "HAVE_BASIC_DEV_T is out of range:" HAVE_BASIC_DEV_T
# endif
#endif

View file

@ -1 +1 @@
configure.ac
configure.in

10
test.sh
View file

@ -6827,7 +6827,7 @@ tdiff="$td/test$N.diff"
# if they are scanned incorrectly, socat will see an "unknown option"
dain='(,)[,]{,}","([),])hugo'
daout='(,)[,]{,},([),])hugo'
"$TRACE $SOCAT" $opts -u "exec:echo $dain" - >"$tf" 2>"$te"
$TRACE $SOCAT $opts -u "exec:echo $dain" - >"$tf" 2>"$te"
rc=$?
echo "$daout" |diff "$tf" - >"$tdiff"
if [ "$rc" -ne 0 ]; then
@ -10077,7 +10077,7 @@ if [ "$tcp" != ',' ]; then
tca="$tca:$tcp"
fi
#CMD0="$TRACE $SOCAT $opts -u $KEYW-LISTEN:$tsa1 system:\"export -p\""
CMD0="$TRACE $SOCAT $opts -u -lpsocat $KEYW-LISTEN:$tsa1 system:\"echo SOCAT_SOCKADDR=\\\$TRACE $SOCAT_SOCKADDR; echo SOCAT_PEERADDR=\\\$TRACE $SOCAT_PEERADDR; echo SOCAT_SOCKPORT=\\\$TRACE $SOCAT_SOCKPORT; echo SOCAT_PEERPORT=\\\$TRACE $SOCAT_PEERPORT; sleep 1\""
CMD0="$TRACE $SOCAT $opts -u -lpsocat $KEYW-LISTEN:$tsa1 system:\"echo SOCAT_SOCKADDR=\\\$SOCAT_SOCKADDR; echo SOCAT_PEERADDR=\\\$SOCAT_PEERADDR; echo SOCAT_SOCKPORT=\\\$SOCAT_SOCKPORT; echo SOCAT_PEERPORT=\\\$SOCAT_PEERPORT; sleep 1\""
CMD1="$TRACE $SOCAT $opts -u - $KEYW-CONNECT:$tsa,bind=$tca"
printf "test $F_n $TEST... " $N
eval "$CMD0 2>\"${te}0\" >\"$tf\" &"
@ -10177,7 +10177,7 @@ case "X$IPPORT" in
tsa="$tra"
esac
#CMD0="$TRACE $SOCAT $opts -u $KEYW-RECVFROM:$tra,reuseaddr,$SCM_RECV system:\"export -p\""
CMD0="$TRACE $SOCAT $opts -u -lpsocat $KEYW-RECVFROM:$tra,reuseaddr,$SCM_RECV system:\"echo \\\$TRACE $SOCAT_$SCM_ENVNAME\""
CMD0="$TRACE $SOCAT $opts -u -lpsocat $KEYW-RECVFROM:$tra,reuseaddr,$SCM_RECV system:\"echo \\\$SOCAT_$SCM_ENVNAME\""
CMD1="$TRACE $SOCAT $opts -u - $KEYW-SENDTO:$tsa,$SCM_ENABLE"
printf "test $F_n $TEST... " $N
# is this option supported?
@ -10203,7 +10203,7 @@ if [ "$rc1" -ne 0 ]; then
cat "${te}1"
numCANT=$((numCANT+1))
#elif ! egrep "^export SOCAT_$SCM_ENVNAME=[\"']?$SCM_VALUE[\"']?\$" ${tf} >/dev/null; then
#elif ! eval echo "$TRACE $SOCAT_\$SCM_VALUE" |diff - "${tf}" >/dev/null; then
#elif ! eval echo "$SOCAT_\$SCM_VALUE" |diff - "${tf}" >/dev/null; then
elif ! expr "$(cat "$tf")" : "$(eval echo "\$SCM_VALUE")" >/dev/null; then
$PRINTF "$FAILED\n"
echo "$CMD0 &"
@ -11289,7 +11289,7 @@ NAME=${EXEC}1BI_CAT_OD_HALFCLOSE_$COMMNAME
case "$TESTS" in
*%$N%*|*%functions%*|*%chain%*|*%$exec%*|*%${exec}1%*|*%$NAME%*)
TEST="$NAME: ${exec}1 in birectional chain, both directions ($commname)"
testod "$N" "$TEST" "STDIO" "${EXEC}1:$TRACE $SOCAT -u - -%${EXEC}1:$OD_C|PIPE" "$opts -c$c" "$val_t"
testod "$N" "$TEST" "STDIO" "${EXEC}1:$SOCAT -u - -%${EXEC}1:$OD_C|PIPE" "$opts -c$c" "$val_t"
esac
N=$((N+1))
;;

View file

@ -237,7 +237,7 @@ int _xioopen_listen(struct single *xfd, int xioflags, struct sockaddr *us, sockl
Notice1("listening on %s", sockaddr_info(us, uslen, lisname, sizeof(lisname)));
ps = Accept(xfd->rfd, (struct sockaddr *)&sa, &salen);
if (ps >= 0) {
/*0 Info4("accept(%d, %p, {"F_socklen"}) -> %d", xfd->fd1, &sa, salen, ps);*/
/*0 Info4("accept(%d, %p, {"F_socklen"}) -> %d", xfd->rfd, &sa, salen, ps);*/
break; /* success, break out of loop */
}
if (errno == EINTR) {

2
xio.h
View file

@ -576,6 +576,8 @@ union integral {
# define u_off u_int
#elif HAVE_BASIC_OFF_T==5
# define u_off u_long
#elif HAVE_BASIC_OFF_T==7
# define u_off u_longlong
#else
# error "unexpected size of off_t, please report this as bug"
#endif

View file

@ -171,7 +171,7 @@ int xioshutdown(xiofile_t *sock, int how) {
fd, strerror(errno));
}
sock->stream.eof = 2;
sock->stream.fd1 = -1;
sock->stream.rfd = -1;
}
break;
#endif /* _WITH_SOCKET */