diff -u -r --new-file --exclude=CVS rsync-2.4.1/acconfig.h rsync-2.4.2/acconfig.h --- rsync-2.4.1/acconfig.h Sat Jan 29 22:35:03 2000 +++ rsync-2.4.2/acconfig.h Fri Mar 31 00:23:00 2000 @@ -11,3 +11,4 @@ #undef HAVE_GETOPT_LONG #undef REPLACE_INET_NTOA #undef HAVE_GETTIMEOFDAY_TZ +#undef HAVE_SOCKETPAIR diff -u -r --new-file --exclude=CVS rsync-2.4.1/clientserver.c rsync-2.4.2/clientserver.c --- rsync-2.4.1/clientserver.c Sat Jan 29 22:35:03 2000 +++ rsync-2.4.2/clientserver.c Fri Mar 31 00:23:01 2000 @@ -363,7 +363,7 @@ set_socket_options(fd,"SO_KEEPALIVE"); set_socket_options(fd,lp_socket_options()); - + set_nonblocking(fd); io_printf(fd,"@RSYNCD: %d\n", PROTOCOL_VERSION); diff -u -r --new-file --exclude=CVS rsync-2.4.1/config.h.in rsync-2.4.2/config.h.in --- rsync-2.4.1/config.h.in Sat Jan 29 22:35:03 2000 +++ rsync-2.4.2/config.h.in Fri Mar 31 00:23:01 2000 @@ -63,6 +63,7 @@ #undef HAVE_GETOPT_LONG #undef REPLACE_INET_NTOA #undef HAVE_GETTIMEOFDAY_TZ +#undef HAVE_SOCKETPAIR /* The number of bytes in a int. */ #undef SIZEOF_INT @@ -117,9 +118,6 @@ /* Define if you have the snprintf function. */ #undef HAVE_SNPRINTF - -/* Define if you have the socketpair function. */ -#undef HAVE_SOCKETPAIR /* Define if you have the strcasecmp function. */ #undef HAVE_STRCASECMP diff -u -r --new-file --exclude=CVS rsync-2.4.1/configure rsync-2.4.2/configure --- rsync-2.4.1/configure Sat Jan 29 22:35:03 2000 +++ rsync-2.4.2/configure Fri Mar 31 00:23:01 2000 @@ -2153,96 +2153,23 @@ fi -echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:2158: checking for 8-bit clean memcmp" >&5 -if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_memcmp_clean=no -else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - ac_cv_func_memcmp_clean=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_func_memcmp_clean=no -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 -test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" - -echo $ac_n "checking whether utime accepts a null argument""... $ac_c" 1>&6 -echo "configure:2194: checking whether utime accepts a null argument" >&5 -if eval "test \"`echo '$''{'ac_cv_func_utime_null'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - rm -f conftestdata; > conftestdata -# Sequent interprets utime(file, 0) to mean use start of epoch. Wrong. -if test "$cross_compiling" = yes; then - ac_cv_func_utime_null=no -else - cat > conftest.$ac_ext < -#include -main() { -struct stat s, t; -exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0 -&& stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime -&& t.st_mtime - s.st_mtime < 120)); -} -EOF -if { (eval echo configure:2215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - ac_cv_func_utime_null=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_func_utime_null=no -fi -rm -fr conftest* -fi - -rm -f core core.* *.core -fi - -echo "$ac_t""$ac_cv_func_utime_null" 1>&6 -if test $ac_cv_func_utime_null = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_UTIME_NULL 1 -EOF - -fi - -for ac_func in waitpid wait4 getcwd strdup strerror chown chmod mknod +# The following test taken from the cvs sources +# If we can't find connect, try looking in -lsocket, -lnsl, and -linet. +# These need checks to be before checks for any other functions that +# might be in the same libraries. +# The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has +# libsocket.so which has a bad implementation of gethostbyname (it +# only looks in /etc/hosts), so we only look for -lsocket if we need +# it. +for ac_func in connect do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2241: checking for $ac_func" >&5 +echo "configure:2168: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2289,580 +2216,526 @@ fi done -for ac_func in fchmod fstat strchr readlink link utime utimes strftime -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2296: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +if test x"$ac_cv_func_connect" = x"no"; then + case "$LIBS" in + *-lnsl*) ;; + *) echo $ac_n "checking for printf in -lnsl_s""... $ac_c" 1>&6 +echo "configure:2224: checking for printf in -lnsl_s" >&5 +ac_lib_var=`echo nsl_s'_'printf | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char $ac_func(); +char printf(); int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - +printf() ; return 0; } EOF -if { (eval echo configure:2324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" + eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -fi +LIBS="$ac_save_LIBS" -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi -done - -for ac_func in memmove lchown vsnprintf snprintf setsid glob strpbrk -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2351: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + ;; + esac + case "$LIBS" in + *-lnsl*) ;; + *) echo $ac_n "checking for printf in -lnsl""... $ac_c" 1>&6 +echo "configure:2274: checking for printf in -lnsl" >&5 +ac_lib_var=`echo nsl'_'printf | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char $ac_func(); +char printf(); int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - +printf() ; return 0; } EOF -if { (eval echo configure:2379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" + eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -fi +LIBS="$ac_save_LIBS" -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi -done - -for ac_func in strlcat strlcpy inet_aton socketpair -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2406: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + ;; + esac + case "$LIBS" in + *-lsocket*) ;; + *) echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 +echo "configure:2324: checking for connect in -lsocket" >&5 +ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char $ac_func(); +char connect(); int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - +connect() ; return 0; } EOF -if { (eval echo configure:2434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" + eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -fi +LIBS="$ac_save_LIBS" -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi -done - - -echo $ac_n "checking for working fnmatch""... $ac_c" 1>&6 -echo "configure:2460: checking for working fnmatch" >&5 -if eval "test \"`echo '$''{'rsync_cv_HAVE_FNMATCH'+set}'`\" = set"; then + ;; + esac + case "$LIBS" in + *-linet*) ;; + *) echo $ac_n "checking for connect in -linet""... $ac_c" 1>&6 +echo "configure:2374: checking for connect in -linet" >&5 +ac_lib_var=`echo inet'_'connect | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - -if test "$cross_compiling" = yes; then - rsync_cv_HAVE_FNMATCH=cross -else - cat > conftest.$ac_ext < conftest.$ac_ext < -main() { exit((fnmatch("*.o", "x.o", FNM_PATHNAME) == 0 && - fnmatch("a/b/*", "a/b/c/d", FNM_PATHNAME) != 0) ? 0: 1); } -EOF -if { (eval echo configure:2475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - rsync_cv_HAVE_FNMATCH=yes +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char connect(); + +int main() { +connect() +; return 0; } +EOF +if { (eval echo configure:2393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -fr conftest* - rsync_cv_HAVE_FNMATCH=no -fi -rm -fr conftest* + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" fi +rm -f conftest* +LIBS="$ac_save_LIBS" fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 -if test x"$rsync_cv_HAVE_FNMATCH" = x"yes"; then - cat >> confdefs.h <<\EOF -#define HAVE_FNMATCH 1 + LIBS="-linet $LIBS" + +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + if test x"$ac_cv_lib_socket_connect" = x"yes" || + test x"$ac_cv_lib_inet_connect" = x"yes"; then + # ac_cv_func_connect=yes + # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run + cat >> confdefs.h <<\EOF +#define HAVE_CONNECT 1 EOF + fi fi -# sometimes getopt_long cannot parse same arguments twice -# e.g. on certain versions of CygWin32 -echo $ac_n "checking for working getopt_long""... $ac_c" 1>&6 -echo "configure:2500: checking for working getopt_long" >&5 -if eval "test \"`echo '$''{'rsync_cv_HAVE_GETOPT_LONG'+set}'`\" = set"; then +# +# if we can't find strcasecmp, look in -lresolv (for Unixware at least) +# +for ac_func in strcasecmp +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2438: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - -if test "$cross_compiling" = yes; then - rsync_cv_HAVE_GETOPT_LONG=cross -else cat > conftest.$ac_ext < -main() { - int i, x = 0; char *argv[] = { "x", "--xx" }; - struct option o[] = {{"xx", 0, 0, 1}, {0,0,0,0}}; - getopt_long(2, argv, "x", o, &i) == 1 ? x++ : 0; optind = 0; - getopt_long(2, argv, "x", o, &i) == 1 ? x++ : 0; - exit(x == 2 ? 0 : 1); -} +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } EOF -if { (eval echo configure:2520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - rsync_cv_HAVE_GETOPT_LONG=yes +if { (eval echo configure:2466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -fr conftest* - rsync_cv_HAVE_GETOPT_LONG=no -fi -rm -fr conftest* + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" fi - +rm -f conftest* fi -echo "$ac_t""$rsync_cv_HAVE_GETOPT_LONG" 1>&6 -if test x"$rsync_cv_HAVE_GETOPT_LONG" = x"yes"; then - cat >> confdefs.h <<\EOF -#define HAVE_GETOPT_LONG 1 +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 fi +done -echo $ac_n "checking for long long""... $ac_c" 1>&6 -echo "configure:2543: checking for long long" >&5 -if eval "test \"`echo '$''{'rsync_cv_HAVE_LONGLONG'+set}'`\" = set"; then +if test x"$ac_cv_func_strcasecmp" = x"no"; then + echo $ac_n "checking for strcasecmp in -lresolv""... $ac_c" 1>&6 +echo "configure:2492: checking for strcasecmp in -lresolv" >&5 +ac_lib_var=`echo resolv'_'strcasecmp | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - -if test "$cross_compiling" = yes; then - rsync_cv_HAVE_LONGLONG=cross -else - cat > conftest.$ac_ext < conftest.$ac_ext < -main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); } +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strcasecmp(); + +int main() { +strcasecmp() +; return 0; } EOF -if { (eval echo configure:2557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - rsync_cv_HAVE_LONGLONG=yes +if { (eval echo configure:2511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -fr conftest* - rsync_cv_HAVE_LONGLONG=no -fi -rm -fr conftest* + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" fi +rm -f conftest* +LIBS="$ac_save_LIBS" fi - -echo "$ac_t""$rsync_cv_HAVE_LONGLONG" 1>&6 -if test x"$rsync_cv_HAVE_LONGLONG" = x"yes"; then - cat >> confdefs.h <<\EOF -#define HAVE_LONGLONG 1 +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 fi -echo $ac_n "checking for off64_t""... $ac_c" 1>&6 -echo "configure:2580: checking for off64_t" >&5 -if eval "test \"`echo '$''{'rsync_cv_HAVE_OFF64_T'+set}'`\" = set"; then +fi + +echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 +echo "configure:2541: checking for 8-bit clean memcmp" >&5 +if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - -if test "$cross_compiling" = yes; then - rsync_cv_HAVE_OFF64_T=cross + if test "$cross_compiling" = yes; then + ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext < -#include -main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); } + +main() +{ + char c0 = 0x40, c1 = 0x80, c2 = 0x81; + exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1); +} + EOF -if { (eval echo configure:2595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then - rsync_cv_HAVE_OFF64_T=yes + ac_cv_func_memcmp_clean=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* - rsync_cv_HAVE_OFF64_T=no + ac_cv_func_memcmp_clean=no fi rm -fr conftest* fi fi -echo "$ac_t""$rsync_cv_HAVE_OFF64_T" 1>&6 -if test x"$rsync_cv_HAVE_OFF64_T" = x"yes"; then - cat >> confdefs.h <<\EOF -#define HAVE_OFF64_T 1 -EOF - -fi +echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 +test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" -echo $ac_n "checking for short ino_t""... $ac_c" 1>&6 -echo "configure:2618: checking for short ino_t" >&5 -if eval "test \"`echo '$''{'rsync_cv_HAVE_SHORT_INO_T'+set}'`\" = set"; then +echo $ac_n "checking whether utime accepts a null argument""... $ac_c" 1>&6 +echo "configure:2577: checking whether utime accepts a null argument" >&5 +if eval "test \"`echo '$''{'ac_cv_func_utime_null'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - + rm -f conftestdata; > conftestdata +# Sequent interprets utime(file, 0) to mean use start of epoch. Wrong. if test "$cross_compiling" = yes; then - rsync_cv_HAVE_SHORT_INO_T=cross + ac_cv_func_utime_null=no else cat > conftest.$ac_ext < #include #include -main() { if (sizeof(ino_t) < sizeof(unsigned int)) return 0; return 1; } +main() { +struct stat s, t; +exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0 +&& stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime +&& t.st_mtime - s.st_mtime < 120)); +} EOF -if { (eval echo configure:2634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then - rsync_cv_HAVE_SHORT_INO_T=yes + ac_cv_func_utime_null=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* - rsync_cv_HAVE_SHORT_INO_T=no + ac_cv_func_utime_null=no fi rm -fr conftest* fi +rm -f core core.* *.core fi -echo "$ac_t""$rsync_cv_HAVE_SHORT_INO_T" 1>&6 -if test x"$rsync_cv_HAVE_SHORT_INO_T" = x"yes"; then - cat >> confdefs.h <<\EOF -#define HAVE_SHORT_INO_T 1 +echo "$ac_t""$ac_cv_func_utime_null" 1>&6 +if test $ac_cv_func_utime_null = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_UTIME_NULL 1 EOF fi -echo $ac_n "checking for unsigned char""... $ac_c" 1>&6 -echo "configure:2657: checking for unsigned char" >&5 -if eval "test \"`echo '$''{'rsync_cv_HAVE_UNSIGNED_CHAR'+set}'`\" = set"; then +for ac_func in waitpid wait4 getcwd strdup strerror chown chmod mknod +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2624: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - -if test "$cross_compiling" = yes; then - rsync_cv_HAVE_UNSIGNED_CHAR=cross -else cat > conftest.$ac_ext < -main() { char c; c=250; exit((c > 0)?0:1); } -EOF -if { (eval echo configure:2671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - rsync_cv_HAVE_UNSIGNED_CHAR=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - rsync_cv_HAVE_UNSIGNED_CHAR=no -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$rsync_cv_HAVE_UNSIGNED_CHAR" 1>&6 -if test x"$rsync_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then - cat >> confdefs.h <<\EOF -#define HAVE_UNSIGNED_CHAR 1 -EOF - -fi - -echo $ac_n "checking for broken readdir""... $ac_c" 1>&6 -echo "configure:2694: checking for broken readdir" >&5 -if eval "test \"`echo '$''{'rsync_cv_HAVE_BROKEN_READDIR'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - -if test "$cross_compiling" = yes; then - rsync_cv_HAVE_BROKEN_READDIR=cross -else - cat > conftest.$ac_ext < -#include -main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d); -if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 && -di->d_name[0] == 0) exit(0); exit(1);} -EOF -if { (eval echo configure:2711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - rsync_cv_HAVE_BROKEN_READDIR=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - rsync_cv_HAVE_BROKEN_READDIR=no -fi -rm -fr conftest* -fi - -fi +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); -echo "$ac_t""$rsync_cv_HAVE_BROKEN_READDIR" 1>&6 -if test x"$rsync_cv_HAVE_BROKEN_READDIR" = x"yes"; then - cat >> confdefs.h <<\EOF -#define HAVE_BROKEN_READDIR 1 -EOF +int main() { -fi +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif -echo $ac_n "checking for utimbuf""... $ac_c" 1>&6 -echo "configure:2734: checking for utimbuf" >&5 -if eval "test \"`echo '$''{'rsync_cv_HAVE_UTIMBUF'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - -cat > conftest.$ac_ext < -#include -int main() { -struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf)); ; return 0; } EOF -if { (eval echo configure:2748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - rsync_cv_HAVE_UTIMBUF=yes + eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - rsync_cv_HAVE_UTIMBUF=no + eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi -echo "$ac_t""$rsync_cv_HAVE_UTIMBUF" 1>&6 -if test x"$rsync_cv_HAVE_UTIMBUF" = x"yes"; then - cat >> confdefs.h <<\EOF -#define HAVE_UTIMBUF 1 +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 fi +done -echo $ac_n "checking if gettimeofday takes tz argument""... $ac_c" 1>&6 -echo "configure:2769: checking if gettimeofday takes tz argument" >&5 -if eval "test \"`echo '$''{'rsync_cv_HAVE_GETTIMEOFDAY_TZ'+set}'`\" = set"; then +for ac_func in fchmod fstat strchr readlink link utime utimes strftime +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2679: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - -if test "$cross_compiling" = yes; then - rsync_cv_HAVE_GETTIMEOFDAY_TZ=cross -else cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); -#include -#include -main() { struct timeval tv; exit(gettimeofday(&tv, NULL));} -EOF -if { (eval echo configure:2785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - rsync_cv_HAVE_GETTIMEOFDAY_TZ=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - rsync_cv_HAVE_GETTIMEOFDAY_TZ=no -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$rsync_cv_HAVE_GETTIMEOFDAY_TZ" 1>&6 -if test x"$rsync_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then - cat >> confdefs.h <<\EOF -#define HAVE_GETTIMEOFDAY_TZ 1 -EOF - -fi - +int main() { -echo $ac_n "checking for broken inet_ntoa""... $ac_c" 1>&6 -echo "configure:2809: checking for broken inet_ntoa" >&5 -if eval "test \"`echo '$''{'rsync_cv_REPLACE_INET_NTOA'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - -if test "$cross_compiling" = yes; then - rsync_cv_REPLACE_INET_NTOA=cross -else - cat > conftest.$ac_ext < -#include -#include -#include -main() { struct in_addr ip; ip.s_addr = 0x12345678; -if (strcmp(inet_ntoa(ip),"18.52.86.120") && - strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); } -exit(1);} +; return 0; } EOF -if { (eval echo configure:2830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - rsync_cv_REPLACE_INET_NTOA=yes +if { (eval echo configure:2707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -fr conftest* - rsync_cv_REPLACE_INET_NTOA=no -fi -rm -fr conftest* + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" fi - +rm -f conftest* fi -echo "$ac_t""$rsync_cv_REPLACE_INET_NTOA" 1>&6 -if test x"$rsync_cv_REPLACE_INET_NTOA" = x"yes"; then - cat >> confdefs.h <<\EOF -#define REPLACE_INET_NTOA 1 +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 fi +done -# The following test taken from the cvs sources -# If we can't find connect, try looking in -lsocket, -lnsl, and -linet. -# The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has -# libsocket.so which has a bad implementation of gethostbyname (it -# only looks in /etc/hosts), so we only look for -lsocket if we need -# it. -for ac_func in connect +for ac_func in memmove lchown vsnprintf snprintf setsid glob strpbrk do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2861: checking for $ac_func" >&5 +echo "configure:2734: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2909,331 +2782,501 @@ fi done -if test x"$ac_cv_func_connect" = x"no"; then - case "$LIBS" in - *-lnsl*) ;; - *) echo $ac_n "checking for printf in -lnsl_s""... $ac_c" 1>&6 -echo "configure:2917: checking for printf in -lnsl_s" >&5 -ac_lib_var=`echo nsl_s'_'printf | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +for ac_func in strlcat strlcpy inet_aton +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2789: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-lnsl_s $LIBS" -cat > conftest.$ac_ext < conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char printf(); +char $ac_func(); int main() { -printf() + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + ; return 0; } EOF -if { (eval echo configure:2936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + eval "ac_cv_func_$ac_func=no" fi rm -f conftest* -LIBS="$ac_save_LIBS" - fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi - ;; - esac - case "$LIBS" in - *-lnsl*) ;; - *) echo $ac_n "checking for printf in -lnsl""... $ac_c" 1>&6 -echo "configure:2967: checking for printf in -lnsl" >&5 -ac_lib_var=`echo nsl'_'printf | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +done + + +echo $ac_n "checking for working socketpair""... $ac_c" 1>&6 +echo "configure:2843: checking for working socketpair" >&5 +if eval "test \"`echo '$''{'rsync_cv_HAVE_SOCKETPAIR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-lnsl $LIBS" -cat > conftest.$ac_ext < conftest.$ac_ext < + #include + main() { + int fd[2]; + exit((socketpair(AF_UNIX, SOCK_STREAM, 0, fd) != -1) ? 0 : 1); + } EOF -if { (eval echo configure:2986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" +if { (eval echo configure:2861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + rsync_cv_HAVE_SOCKETPAIR=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + rm -fr conftest* + rsync_cv_HAVE_SOCKETPAIR=no +fi +rm -fr conftest* fi -rm -f conftest* -LIBS="$ac_save_LIBS" fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&6 +if test x"$rsync_cv_HAVE_SOCKETPAIR" = x"yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_SOCKETPAIR 1 EOF - LIBS="-lnsl $LIBS" +fi +echo $ac_n "checking for working fnmatch""... $ac_c" 1>&6 +echo "configure:2884: checking for working fnmatch" >&5 +if eval "test \"`echo '$''{'rsync_cv_HAVE_FNMATCH'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else - echo "$ac_t""no" 1>&6 + +if test "$cross_compiling" = yes; then + rsync_cv_HAVE_FNMATCH=cross +else + cat > conftest.$ac_ext < +main() { exit((fnmatch("*.o", "x.o", FNM_PATHNAME) == 0 && + fnmatch("a/b/*", "a/b/c/d", FNM_PATHNAME) != 0) ? 0: 1); } +EOF +if { (eval echo configure:2899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + rsync_cv_HAVE_FNMATCH=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + rsync_cv_HAVE_FNMATCH=no fi - ;; - esac - case "$LIBS" in - *-lsocket*) ;; - *) echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:3017: checking for connect in -lsocket" >&5 -ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +rm -fr conftest* +fi + +fi + +echo "$ac_t""$rsync_cv_HAVE_FNMATCH" 1>&6 +if test x"$rsync_cv_HAVE_FNMATCH" = x"yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_FNMATCH 1 +EOF + +fi + +# sometimes getopt_long cannot parse same arguments twice +# e.g. on certain versions of CygWin32 +echo $ac_n "checking for working getopt_long""... $ac_c" 1>&6 +echo "configure:2924: checking for working getopt_long" >&5 +if eval "test \"`echo '$''{'rsync_cv_HAVE_GETOPT_LONG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-lsocket $LIBS" -cat > conftest.$ac_ext < conftest.$ac_ext < +main() { + int i, x = 0; char *argv[] = { "x", "--xx" }; + struct option o[] = {{"xx", 0, 0, 1}, {0,0,0,0}}; + getopt_long(2, argv, "x", o, &i) == 1 ? x++ : 0; optind = 0; + getopt_long(2, argv, "x", o, &i) == 1 ? x++ : 0; + exit(x == 2 ? 0 : 1); +} EOF -if { (eval echo configure:3036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" +if { (eval echo configure:2944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + rsync_cv_HAVE_GETOPT_LONG=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + rm -fr conftest* + rsync_cv_HAVE_GETOPT_LONG=no +fi +rm -fr conftest* fi -rm -f conftest* -LIBS="$ac_save_LIBS" fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&6 +if test x"$rsync_cv_HAVE_GETOPT_LONG" = x"yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_GETOPT_LONG 1 EOF - LIBS="-lsocket $LIBS" +fi +echo $ac_n "checking for long long""... $ac_c" 1>&6 +echo "configure:2967: checking for long long" >&5 +if eval "test \"`echo '$''{'rsync_cv_HAVE_LONGLONG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else - echo "$ac_t""no" 1>&6 + +if test "$cross_compiling" = yes; then + rsync_cv_HAVE_LONGLONG=cross +else + cat > conftest.$ac_ext < +main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); } +EOF +if { (eval echo configure:2981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + rsync_cv_HAVE_LONGLONG=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + rsync_cv_HAVE_LONGLONG=no fi - ;; - esac - case "$LIBS" in - *-linet*) ;; - *) echo $ac_n "checking for connect in -linet""... $ac_c" 1>&6 -echo "configure:3067: checking for connect in -linet" >&5 -ac_lib_var=`echo inet'_'connect | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +rm -fr conftest* +fi + +fi + +echo "$ac_t""$rsync_cv_HAVE_LONGLONG" 1>&6 +if test x"$rsync_cv_HAVE_LONGLONG" = x"yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_LONGLONG 1 +EOF + +fi + +echo $ac_n "checking for off64_t""... $ac_c" 1>&6 +echo "configure:3004: checking for off64_t" >&5 +if eval "test \"`echo '$''{'rsync_cv_HAVE_OFF64_T'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-linet $LIBS" -cat > conftest.$ac_ext < conftest.$ac_ext < +#include +main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); } EOF -if { (eval echo configure:3086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" +if { (eval echo configure:3019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + rsync_cv_HAVE_OFF64_T=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + rm -fr conftest* + rsync_cv_HAVE_OFF64_T=no +fi +rm -fr conftest* fi -rm -f conftest* -LIBS="$ac_save_LIBS" fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&6 +if test x"$rsync_cv_HAVE_OFF64_T" = x"yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_OFF64_T 1 EOF - LIBS="-linet $LIBS" +fi +echo $ac_n "checking for short ino_t""... $ac_c" 1>&6 +echo "configure:3042: checking for short ino_t" >&5 +if eval "test \"`echo '$''{'rsync_cv_HAVE_SHORT_INO_T'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else - echo "$ac_t""no" 1>&6 + +if test "$cross_compiling" = yes; then + rsync_cv_HAVE_SHORT_INO_T=cross +else + cat > conftest.$ac_ext < +#include +#include +main() { if (sizeof(ino_t) < sizeof(unsigned int)) return 0; return 1; } +EOF +if { (eval echo configure:3058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + rsync_cv_HAVE_SHORT_INO_T=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + rsync_cv_HAVE_SHORT_INO_T=no fi - ;; - esac - if test x"$ac_cv_lib_socket_connect" = x"yes" || - test x"$ac_cv_lib_inet_connect" = x"yes"; then - # ac_cv_func_connect=yes - # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run - cat >> confdefs.h <<\EOF -#define HAVE_CONNECT 1 +rm -fr conftest* +fi + +fi + +echo "$ac_t""$rsync_cv_HAVE_SHORT_INO_T" 1>&6 +if test x"$rsync_cv_HAVE_SHORT_INO_T" = x"yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_SHORT_INO_T 1 EOF - fi fi -# -# if we can't find strcasecmp, look in -lresolv (for Unixware at least) -# -for ac_func in strcasecmp -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3131: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +echo $ac_n "checking for unsigned char""... $ac_c" 1>&6 +echo "configure:3081: checking for unsigned char" >&5 +if eval "test \"`echo '$''{'rsync_cv_HAVE_UNSIGNED_CHAR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else + +if test "$cross_compiling" = yes; then + rsync_cv_HAVE_UNSIGNED_CHAR=cross +else cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); +#include +main() { char c; c=250; exit((c > 0)?0:1); } +EOF +if { (eval echo configure:3095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + rsync_cv_HAVE_UNSIGNED_CHAR=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + rsync_cv_HAVE_UNSIGNED_CHAR=no +fi +rm -fr conftest* +fi -int main() { +fi -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif +echo "$ac_t""$rsync_cv_HAVE_UNSIGNED_CHAR" 1>&6 +if test x"$rsync_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_UNSIGNED_CHAR 1 +EOF -; return 0; } +fi + +echo $ac_n "checking for broken readdir""... $ac_c" 1>&6 +echo "configure:3118: checking for broken readdir" >&5 +if eval "test \"`echo '$''{'rsync_cv_HAVE_BROKEN_READDIR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +if test "$cross_compiling" = yes; then + rsync_cv_HAVE_BROKEN_READDIR=cross +else + cat > conftest.$ac_ext < +#include +main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d); +if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 && +di->d_name[0] == 0) exit(0); exit(1);} EOF -if { (eval echo configure:3159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" +if { (eval echo configure:3135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + rsync_cv_HAVE_BROKEN_READDIR=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + rm -fr conftest* + rsync_cv_HAVE_BROKEN_READDIR=no fi -rm -f conftest* +rm -fr conftest* fi -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 +if test x"$rsync_cv_HAVE_BROKEN_READDIR" = x"yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_BROKEN_READDIR 1 EOF - -else - echo "$ac_t""no" 1>&6 + fi -done -if test x"$ac_cv_func_strcasecmp" = x"no"; then - echo $ac_n "checking for strcasecmp in -lresolv""... $ac_c" 1>&6 -echo "configure:3185: checking for strcasecmp in -lresolv" >&5 -ac_lib_var=`echo resolv'_'strcasecmp | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +echo $ac_n "checking for utimbuf""... $ac_c" 1>&6 +echo "configure:3158: checking for utimbuf" >&5 +if eval "test \"`echo '$''{'rsync_cv_HAVE_UTIMBUF'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-lresolv $LIBS" + cat > conftest.$ac_ext < +#include int main() { -strcasecmp() +struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf)); ; return 0; } EOF -if { (eval echo configure:3204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + rsync_cv_HAVE_UTIMBUF=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + rsync_cv_HAVE_UTIMBUF=no fi rm -f conftest* -LIBS="$ac_save_LIBS" +fi + +echo "$ac_t""$rsync_cv_HAVE_UTIMBUF" 1>&6 +if test x"$rsync_cv_HAVE_UTIMBUF" = x"yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_UTIMBUF 1 +EOF fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&6 +echo "configure:3193: checking if gettimeofday takes tz argument" >&5 +if eval "test \"`echo '$''{'rsync_cv_HAVE_GETTIMEOFDAY_TZ'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +if test "$cross_compiling" = yes; then + rsync_cv_HAVE_GETTIMEOFDAY_TZ=cross +else + cat > conftest.$ac_ext < +#include +main() { struct timeval tv; exit(gettimeofday(&tv, NULL));} +EOF +if { (eval echo configure:3209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + rsync_cv_HAVE_GETTIMEOFDAY_TZ=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + rsync_cv_HAVE_GETTIMEOFDAY_TZ=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$rsync_cv_HAVE_GETTIMEOFDAY_TZ" 1>&6 +if test x"$rsync_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_GETTIMEOFDAY_TZ 1 EOF - LIBS="-lresolv $LIBS" +fi + +echo $ac_n "checking for broken inet_ntoa""... $ac_c" 1>&6 +echo "configure:3233: checking for broken inet_ntoa" >&5 +if eval "test \"`echo '$''{'rsync_cv_REPLACE_INET_NTOA'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else - echo "$ac_t""no" 1>&6 + +if test "$cross_compiling" = yes; then + rsync_cv_REPLACE_INET_NTOA=cross +else + cat > conftest.$ac_ext < +#include +#include +#include +main() { struct in_addr ip; ip.s_addr = 0x12345678; +if (strcmp(inet_ntoa(ip),"18.52.86.120") && + strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); } +exit(1);} +EOF +if { (eval echo configure:3254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + rsync_cv_REPLACE_INET_NTOA=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + rsync_cv_REPLACE_INET_NTOA=no +fi +rm -fr conftest* +fi + fi +echo "$ac_t""$rsync_cv_REPLACE_INET_NTOA" 1>&6 +if test x"$rsync_cv_REPLACE_INET_NTOA" = x"yes"; then + cat >> confdefs.h <<\EOF +#define REPLACE_INET_NTOA 1 +EOF + fi # # The following test was mostly taken from the tcl/tk plus patches # echo $ac_n "checking whether -c -o works""... $ac_c" 1>&6 -echo "configure:3237: checking whether -c -o works" >&5 +echo "configure:3280: checking whether -c -o works" >&5 if eval "test \"`echo '$''{'rsync_cv_DASHC_WORKS_WITH_DASHO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else diff -u -r --new-file --exclude=CVS rsync-2.4.1/configure.in rsync-2.4.2/configure.in --- rsync-2.4.1/configure.in Sat Jan 29 22:35:03 2000 +++ rsync-2.4.2/configure.in Fri Mar 31 00:23:01 2000 @@ -48,12 +48,68 @@ AC_DEFINE(HAVE_ERRNO_DECL) fi +# The following test taken from the cvs sources +# If we can't find connect, try looking in -lsocket, -lnsl, and -linet. +# These need checks to be before checks for any other functions that +# might be in the same libraries. +# The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has +# libsocket.so which has a bad implementation of gethostbyname (it +# only looks in /etc/hosts), so we only look for -lsocket if we need +# it. +AC_CHECK_FUNCS(connect) +if test x"$ac_cv_func_connect" = x"no"; then + case "$LIBS" in + *-lnsl*) ;; + *) AC_CHECK_LIB(nsl_s, printf) ;; + esac + case "$LIBS" in + *-lnsl*) ;; + *) AC_CHECK_LIB(nsl, printf) ;; + esac + case "$LIBS" in + *-lsocket*) ;; + *) AC_CHECK_LIB(socket, connect) ;; + esac + case "$LIBS" in + *-linet*) ;; + *) AC_CHECK_LIB(inet, connect) ;; + esac + dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value + dnl has been cached. + if test x"$ac_cv_lib_socket_connect" = x"yes" || + test x"$ac_cv_lib_inet_connect" = x"yes"; then + # ac_cv_func_connect=yes + # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run + AC_DEFINE(HAVE_CONNECT) + fi +fi + +# +# if we can't find strcasecmp, look in -lresolv (for Unixware at least) +# +AC_CHECK_FUNCS(strcasecmp) +if test x"$ac_cv_func_strcasecmp" = x"no"; then + AC_CHECK_LIB(resolv, strcasecmp) +fi + AC_FUNC_MEMCMP AC_FUNC_UTIME_NULL AC_CHECK_FUNCS(waitpid wait4 getcwd strdup strerror chown chmod mknod) AC_CHECK_FUNCS(fchmod fstat strchr readlink link utime utimes strftime) AC_CHECK_FUNCS(memmove lchown vsnprintf snprintf setsid glob strpbrk) -AC_CHECK_FUNCS(strlcat strlcpy inet_aton socketpair) +AC_CHECK_FUNCS(strlcat strlcpy inet_aton) + +AC_CACHE_CHECK([for working socketpair],rsync_cv_HAVE_SOCKETPAIR,[ +AC_TRY_RUN([#include + #include + main() { + int fd[2]; + exit((socketpair(AF_UNIX, SOCK_STREAM, 0, fd) != -1) ? 0 : 1); + }], +rsync_cv_HAVE_SOCKETPAIR=yes,rsync_cv_HAVE_SOCKETPAIR=no,rsync_cv_HAVE_SOCKETPAIR=cross)]) +if test x"$rsync_cv_HAVE_SOCKETPAIR" = x"yes"; then + AC_DEFINE(HAVE_SOCKETPAIR) +fi AC_CACHE_CHECK([for working fnmatch],rsync_cv_HAVE_FNMATCH,[ AC_TRY_RUN([#include @@ -159,48 +215,6 @@ rsync_cv_REPLACE_INET_NTOA=yes,rsync_cv_REPLACE_INET_NTOA=no,rsync_cv_REPLACE_INET_NTOA=cross)]) if test x"$rsync_cv_REPLACE_INET_NTOA" = x"yes"; then AC_DEFINE(REPLACE_INET_NTOA) -fi - -# The following test taken from the cvs sources -# If we can't find connect, try looking in -lsocket, -lnsl, and -linet. -# The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has -# libsocket.so which has a bad implementation of gethostbyname (it -# only looks in /etc/hosts), so we only look for -lsocket if we need -# it. -AC_CHECK_FUNCS(connect) -if test x"$ac_cv_func_connect" = x"no"; then - case "$LIBS" in - *-lnsl*) ;; - *) AC_CHECK_LIB(nsl_s, printf) ;; - esac - case "$LIBS" in - *-lnsl*) ;; - *) AC_CHECK_LIB(nsl, printf) ;; - esac - case "$LIBS" in - *-lsocket*) ;; - *) AC_CHECK_LIB(socket, connect) ;; - esac - case "$LIBS" in - *-linet*) ;; - *) AC_CHECK_LIB(inet, connect) ;; - esac - dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value - dnl has been cached. - if test x"$ac_cv_lib_socket_connect" = x"yes" || - test x"$ac_cv_lib_inet_connect" = x"yes"; then - # ac_cv_func_connect=yes - # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run - AC_DEFINE(HAVE_CONNECT) - fi -fi - -# -# if we can't find strcasecmp, look in -lresolv (for Unixware at least) -# -AC_CHECK_FUNCS(strcasecmp) -if test x"$ac_cv_func_strcasecmp" = x"no"; then - AC_CHECK_LIB(resolv, strcasecmp) fi # diff -u -r --new-file --exclude=CVS rsync-2.4.1/cvs.log rsync-2.4.2/cvs.log --- rsync-2.4.1/cvs.log Sun Jan 30 12:03:07 2000 +++ rsync-2.4.2/cvs.log Fri Mar 31 00:24:51 2000 @@ -11000,3 +11000,125 @@ Log Message: preparing for release of 2.4.1 + +**************************************** +Date: Wednesday February 16, 2000 @ 9:44 +Author: dwd + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv23477 + +Modified Files: + configure configure.in +Log Message: +Move the checking for -lsocket -lnsl ahead of the checking for most of +the functions, especially "socketpair" so that socket-related functions will +be properly discovered on SVR4-based systems such as Solaris. Problem +discovered by Kenji Miyake + + + +**************************************** +Date: Wednesday February 23, 2000 @ 2:55 +Author: dwd + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv20060 + +Modified Files: + configure configure.in +Log Message: +Change socketpair test to verify that it works rather than just exists, +because I have an obscure system (Amdahl's UTS 2.1.2) in which socketpair() +exists but is broken. + + + +**************************************** +Date: Wednesday February 23, 2000 @ 6:47 +Author: dwd + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv13008 + +Modified Files: + rsync.1 rsync.yo +Log Message: +Somebody was confused into thinking that "Here are some examples" in the +section on exclude/include was supposed to be about "+/-" so I changed +the statement to "Here are some exclude/include examples". + + + + +**************************************** +Date: Saturday February 26, 2000 @ 4:02 +Author: dwd + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv1563 + +Modified Files: + rsyncd.conf.5 rsyncd.conf.yo +Log Message: +Describe symbolic link handling when writing to a "use chroot = no" module. + + + +**************************************** +Date: Tuesday March 21, 2000 @ 15:06 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv27413 + +Modified Files: + flist.c options.c receiver.c rsync.1 rsync.yo +Log Message: +add a --ignore-errors option + + + +**************************************** +Date: Friday March 31, 2000 @ 0:15 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv682 + +Modified Files: + acconfig.h clientserver.c config.h.in io.c main.c proto.h + rsync.h util.c +Log Message: +went back to non-blokcing IO + +it looks like ssh is willing to accept a non-blocking fd when used as +a transport, this seems to avoid the Solaris socketpair bug + + + +**************************************** +Date: Friday March 31, 2000 @ 0:24 +Author: rsync-bu + +Update of /data/cvs/rsync +In directory samba:/data/people/rsync-bugs/rsync + +Modified Files: + version.h +Log Message: +preparing for release of 2.4.2 + + +**************************************** +Date: Friday March 31, 2000 @ 0:24 +Author: rsync-bu + +Update of /data/cvs/rsync/packaging/redhat/5.0 +In directory samba:/data/people/rsync-bugs/rsync/packaging/redhat/5.0 + +Modified Files: + rsync.spec +Log Message: +preparing for release of 2.4.2 + diff -u -r --new-file --exclude=CVS rsync-2.4.1/flist.c rsync-2.4.2/flist.c --- rsync-2.4.1/flist.c Sat Jan 29 22:35:03 2000 +++ rsync-2.4.2/flist.c Fri Mar 31 00:23:02 2000 @@ -862,7 +862,8 @@ /* if protocol version is >= 17 then recv the io_error flag */ if (f != -1 && remote_version >= 17) { extern int module_id; - if (lp_ignore_errors(module_id)) { + extern int ignore_errors; + if (lp_ignore_errors(module_id) || ignore_errors) { read_int(f); } else { io_error |= read_int(f); diff -u -r --new-file --exclude=CVS rsync-2.4.1/io.c rsync-2.4.2/io.c --- rsync-2.4.1/io.c Sun Jan 30 12:02:01 2000 +++ rsync-2.4.2/io.c Fri Mar 31 00:23:02 2000 @@ -159,6 +159,11 @@ continue; } + if (n == -1 && + (errno == EWOULDBLOCK || errno == EAGAIN)) { + continue; + } + if (n == 0) { if (eof_error) { @@ -364,9 +369,14 @@ if (FD_ISSET(fd, &w_fds)) { int ret, n = len-total; - ret = write(fd,buf+total,n?n:1); + ret = write(fd,buf+total,n); if (ret == -1 && errno == EINTR) { + continue; + } + + if (ret == -1 && + (errno == EWOULDBLOCK || errno == EAGAIN)) { continue; } diff -u -r --new-file --exclude=CVS rsync-2.4.1/main.c rsync-2.4.2/main.c --- rsync-2.4.1/main.c Sun Jan 30 12:02:01 2000 +++ rsync-2.4.2/main.c Fri Mar 31 00:23:02 2000 @@ -417,6 +417,9 @@ setup_protocol(f_out, f_in); + set_nonblocking(f_in); + set_nonblocking(f_out); + if (remote_version >= 23) io_start_multiplex_out(f_out); @@ -440,6 +443,9 @@ extern int list_only; extern int remote_version; + set_nonblocking(f_in); + set_nonblocking(f_out); + setup_protocol(f_out,f_in); if (remote_version >= 23) @@ -695,6 +701,8 @@ #endif if (am_server) { + set_nonblocking(STDIN_FILENO); + set_nonblocking(STDOUT_FILENO); start_server(STDIN_FILENO, STDOUT_FILENO, argc, argv); } diff -u -r --new-file --exclude=CVS rsync-2.4.1/options.c rsync-2.4.2/options.c --- rsync-2.4.1/options.c Sat Jan 29 22:35:03 2000 +++ rsync-2.4.2/options.c Fri Mar 31 00:23:02 2000 @@ -65,6 +65,7 @@ int delete_after=0; int only_existing=0; int max_delete=0; +int ignore_errors=0; char *backup_suffix = BACKUP_SUFFIX; char *tmpdir = NULL; @@ -133,6 +134,7 @@ rprintf(F," --delete delete files that don't exist on the sending side\n"); rprintf(F," --delete-excluded also delete excluded files on the receiving side\n"); rprintf(F," --delete-after delete after transferring, not before\n"); + rprintf(F," --ignore-errors delete even if there are IO errors\n"); rprintf(F," --max-delete=NUM don't delete more than NUM files\n"); rprintf(F," --partial keep partially transferred files\n"); rprintf(F," --force force deletion of directories even if not empty\n"); @@ -171,7 +173,8 @@ OPT_INCLUDE, OPT_INCLUDE_FROM, OPT_STATS, OPT_PARTIAL, OPT_PROGRESS, OPT_COPY_UNSAFE_LINKS, OPT_SAFE_LINKS, OPT_COMPARE_DEST, OPT_LOG_FORMAT, OPT_PASSWORD_FILE, OPT_SIZE_ONLY, OPT_ADDRESS, - OPT_DELETE_AFTER, OPT_EXISTING, OPT_MAX_DELETE, OPT_BACKUP_DIR}; + OPT_DELETE_AFTER, OPT_EXISTING, OPT_MAX_DELETE, OPT_BACKUP_DIR, + OPT_IGNORE_ERRORS}; static char *short_options = "oblLWHpguDCtcahvqrRIxnSe:B:T:zP"; @@ -228,6 +231,7 @@ {"progress", 0, 0, OPT_PROGRESS}, {"partial", 0, 0, OPT_PARTIAL}, {"delete-after",0, 0, OPT_DELETE_AFTER}, + {"ignore-errors",0, 0, OPT_IGNORE_ERRORS}, {"config", 1, 0, OPT_CONFIG}, {"port", 1, 0, OPT_PORT}, {"log-format", 1, 0, OPT_LOG_FORMAT}, @@ -528,6 +532,10 @@ keep_partial = 1; break; + case OPT_IGNORE_ERRORS: + ignore_errors = 1; + break; + case 'P': do_progress = 1; keep_partial = 1; @@ -669,6 +677,9 @@ if (delete_after) args[ac++] = "--delete-after"; + + if (ignore_errors) + args[ac++] = "--ignore-errors"; if (copy_unsafe_links) args[ac++] = "--copy-unsafe-links"; diff -u -r --new-file --exclude=CVS rsync-2.4.1/packaging/redhat/5.0/rsync.spec rsync-2.4.2/packaging/redhat/5.0/rsync.spec --- rsync-2.4.1/packaging/redhat/5.0/rsync.spec Sun Jan 30 12:02:58 2000 +++ rsync-2.4.2/packaging/redhat/5.0/rsync.spec Fri Mar 31 00:24:32 2000 @@ -1,10 +1,10 @@ Summary: Program for efficient remote updates of files. Name: rsync -Version: 2.4.1 +Version: 2.4.2 Release: 1 Copyright: GPL Group: Applications/Networking -Source: ftp://samba.anu.edu.au/pub/rsync/rsync-2.4.1.tar.gz +Source: ftp://samba.anu.edu.au/pub/rsync/rsync-2.4.2.tar.gz URL: http://samba.anu.edu.au/rsync/ Packager: Andrew Tridgell BuildRoot: /tmp/rsync diff -u -r --new-file --exclude=CVS rsync-2.4.1/proto.h rsync-2.4.2/proto.h --- rsync-2.4.1/proto.h Sat Jan 29 22:35:03 2000 +++ rsync-2.4.2/proto.h Fri Mar 31 00:23:03 2000 @@ -131,7 +131,6 @@ BOOL pm_process( char *FileName, BOOL (*sfunc)(char *), BOOL (*pfunc)(char *, char *) ); -int pipe(int fd[2]); void delete_files(struct file_list *flist); int recv_files(int f_in,struct file_list *flist,char *local_name,int f_gen); void free_sums(struct sum_struct *s); @@ -175,6 +174,7 @@ void add_gid(gid_t gid); void send_uid_list(int f); void recv_uid_list(int f, struct file_list *flist); +void set_nonblocking(int fd); int fd_pair(int fd[2]); int piped_child(char **command,int *f_in,int *f_out); int local_child(int argc, char **argv,int *f_in,int *f_out); diff -u -r --new-file --exclude=CVS rsync-2.4.1/receiver.c rsync-2.4.2/receiver.c --- rsync-2.4.1/receiver.c Sat Jan 29 22:35:03 2000 +++ rsync-2.4.2/receiver.c Fri Mar 31 00:23:03 2000 @@ -108,13 +108,14 @@ int i, j; char *name; extern int module_id; + extern int ignore_errors; extern int max_delete; static int deletion_count; if (cvs_exclude) add_cvs_excludes(); - if (io_error && !lp_ignore_errors(module_id)) { + if (io_error && !(lp_ignore_errors(module_id) || ignore_errors)) { rprintf(FINFO,"IO error encountered - skipping file deletion\n"); return; } diff -u -r --new-file --exclude=CVS rsync-2.4.1/rsync.1 rsync-2.4.2/rsync.1 --- rsync-2.4.1/rsync.1 Sat Jan 29 22:35:03 2000 +++ rsync-2.4.2/rsync.1 Fri Mar 31 00:23:03 2000 @@ -277,6 +277,7 @@ --delete delete files that don\'t exist on the sending side --delete-excluded also delete excluded files on the receiving side --delete-after delete after transferring, not before + --ignore-errors delete even if there are IO errors --max-delete=NUM don\'t delete more than NUM files --partial keep partially transferred files --force force deletion of directories even if not empty @@ -806,7 +807,7 @@ The +/- rules are most useful in exclude lists, allowing you to have a single exclude list that contains both include and exclude options\&. .PP -Here are some examples: +Here are some exclude/include examples: .PP .IP o --exclude "*\&.o" would exclude all filenames matching *\&.o diff -u -r --new-file --exclude=CVS rsync-2.4.1/rsync.h rsync-2.4.2/rsync.h --- rsync-2.4.1/rsync.h Sun Jan 30 12:02:01 2000 +++ rsync-2.4.2/rsync.h Fri Mar 31 00:23:03 2000 @@ -457,6 +457,15 @@ #define S_ISREG(mode) (((mode) & (_S_IFMT)) == (_S_IFREG)) #endif +/* work out what fcntl flag to use for non-blocking */ +#ifdef O_NONBLOCK +# define NONBLOCK_FLAG O_NONBLOCK +#elif defined(SYSV) +# define NONBLOCK_FLAG O_NDELAY +#else +# define NONBLOCK_FLAG FNDELAY +#endif + #define IS_DEVICE(mode) (S_ISCHR(mode) || S_ISBLK(mode) || S_ISSOCK(mode) || S_ISFIFO(mode)) diff -u -r --new-file --exclude=CVS rsync-2.4.1/rsync.yo rsync-2.4.2/rsync.yo --- rsync-2.4.1/rsync.yo Sat Jan 29 22:35:03 2000 +++ rsync-2.4.2/rsync.yo Fri Mar 31 00:23:03 2000 @@ -248,6 +248,7 @@ --delete delete files that don't exist on the sending side --delete-excluded also delete excluded files on the receiving side --delete-after delete after transferring, not before + --ignore-errors delete even if there are IO errors --max-delete=NUM don't delete more than NUM files --partial keep partially transferred files --force force deletion of directories even if not empty @@ -699,7 +700,7 @@ The +/- rules are most useful in exclude lists, allowing you to have a single exclude list that contains both include and exclude options. -Here are some examples: +Here are some exclude/include examples: itemize( it() --exclude "*.o" would exclude all filenames matching *.o diff -u -r --new-file --exclude=CVS rsync-2.4.1/rsyncd.conf.5 rsync-2.4.2/rsyncd.conf.5 --- rsync-2.4.1/rsyncd.conf.5 Tue Nov 9 00:15:02 1999 +++ rsync-2.4.2/rsyncd.conf.5 Fri Mar 31 00:23:03 2000 @@ -136,8 +136,11 @@ to the "path" before starting the file transfer with the client\&. This has the advantage of extra protection against possible implementation security holes, but it has the disadvantages of requiring super-user privileges and -of not being able to follow symbolic links outside of the new root path\&. -The default is to use chroot\&. +of not being able to follow symbolic links outside of the new root path +when reading\&. For writing when "use chroot" is false, for security reasons +symlinks may only be relative paths pointing to other files within the +root path, and leading slashes are removed from absolute paths\&. The +default for "use chroot" is true\&. .IP .IP "\fBmax connections\fP" The "max connections" option allows you to diff -u -r --new-file --exclude=CVS rsync-2.4.1/rsyncd.conf.yo rsync-2.4.2/rsyncd.conf.yo --- rsync-2.4.1/rsyncd.conf.yo Tue Nov 9 00:15:02 1999 +++ rsync-2.4.2/rsyncd.conf.yo Fri Mar 31 00:23:03 2000 @@ -128,8 +128,11 @@ to the "path" before starting the file transfer with the client. This has the advantage of extra protection against possible implementation security holes, but it has the disadvantages of requiring super-user privileges and -of not being able to follow symbolic links outside of the new root path. -The default is to use chroot. +of not being able to follow symbolic links outside of the new root path +when reading. For writing when "use chroot" is false, for security reasons +symlinks may only be relative paths pointing to other files within the +root path, and leading slashes are removed from absolute paths. The +default for "use chroot" is true. dit(bf(max connections)) The "max connections" option allows you to specify the maximum number of simultaneous connections you will allow diff -u -r --new-file --exclude=CVS rsync-2.4.1/util.c rsync-2.4.2/util.c --- rsync-2.4.1/util.c Sat Jan 29 22:35:03 2000 +++ rsync-2.4.2/util.c Fri Mar 31 00:23:04 2000 @@ -26,15 +26,47 @@ extern int verbose; -/* create a file descriptor - like pipe() but use socketpair if - possible (because of blocking issues on pipes */ + +/**************************************************************************** +Set a fd into nonblocking mode. Uses POSIX O_NONBLOCK if available, +else +if SYSV use O_NDELAY +if BSD use FNDELAY +****************************************************************************/ +void set_nonblocking(int fd) +{ + int val; + + if((val = fcntl(fd, F_GETFL, 0)) == -1) + return; + if (!(val & NONBLOCK_FLAG)) { + val |= NONBLOCK_FLAG; + fcntl(fd, F_SETFL, val); + } +} + + +/* create a file descriptor pair - like pipe() but use socketpair if + possible (because of blocking issues on pipes) + + always set non-blocking + */ int fd_pair(int fd[2]) { + int ret; + #if HAVE_SOCKETPAIR - return socketpair(AF_UNIX, SOCK_STREAM, 0, fd); + ret = socketpair(AF_UNIX, SOCK_STREAM, 0, fd); #else - return pipe(fd); + ret = pipe(fd); #endif + + if (ret == 0) { + set_nonblocking(fd[0]); + set_nonblocking(fd[1]); + } + + return ret; } diff -u -r --new-file --exclude=CVS rsync-2.4.1/version.h rsync-2.4.2/version.h --- rsync-2.4.1/version.h Sun Jan 30 12:02:57 2000 +++ rsync-2.4.2/version.h Fri Mar 31 00:24:31 2000 @@ -1 +1 @@ -#define VERSION "2.4.1" +#define VERSION "2.4.2"