diff --git a/CHANGES b/CHANGES index 3e2e449..ba3b0d7 100644 --- a/CHANGES +++ b/CHANGES @@ -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 diff --git a/Makefile.in b/Makefile.in index 5ebe0f7..408d1a7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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) diff --git a/compat.h b/compat.h index 8906f66..19a929f 100644 --- a/compat.h +++ b/compat.h @@ -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 diff --git a/configure.ac b/configure.ac index 2858741..ef3351b 120000 --- a/configure.ac +++ b/configure.ac @@ -1 +1 @@ -configure.ac \ No newline at end of file +configure.in \ No newline at end of file diff --git a/test.sh b/test.sh index 6dd3ae9..6ac323f 100755 --- a/test.sh +++ b/test.sh @@ -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)) ;; diff --git a/xio-listen.c b/xio-listen.c index 718389f..65679bc 100644 --- a/xio-listen.c +++ b/xio-listen.c @@ -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) { diff --git a/xio.h b/xio.h index 187010d..abb5cde 100644 --- a/xio.h +++ b/xio.h @@ -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 diff --git a/xioshutdown.c b/xioshutdown.c index df53ae9..2c2f4c6 100644 --- a/xioshutdown.c +++ b/xioshutdown.c @@ -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 */