diff -u -r --new-file --exclude=CVS rsync-1.6.6/Makefile.in rsync-1.6.7/Makefile.in --- rsync-1.6.6/Makefile.in Tue Dec 16 04:57:28 1997 +++ rsync-1.6.7/Makefile.in Wed Dec 17 11:10:22 1997 @@ -1,8 +1,10 @@ # Makefile for rsync. This is processed by configure to produce the final # Makefile -INSTALL_BIN=@prefix@/bin -INSTALL_MAN=@prefix@/man +prefix=@prefix@ +exec_prefix=@exec_prefix@ +INSTALL_BIN=$(exec_prefix)/bin +INSTALL_MAN=$(prefix)/man LIBS=@LIBS@ CC=@CC@ diff -u -r --new-file --exclude=CVS rsync-1.6.6/README rsync-1.6.7/README --- rsync-1.6.6/README Mon Dec 15 23:05:07 1997 +++ rsync-1.6.7/README Wed Dec 17 11:10:22 1997 @@ -22,6 +22,7 @@ Here is a brief description of available options: +Options: -v, --verbose increase verbosity -c, --checksum always checksum -a, --archive archive mode (same as -rlptDog) @@ -30,6 +31,7 @@ -b, --backup make backups (default ~ extension) -u, --update update only (don't overwrite newer files) -l, --links preserve soft links +-L, --copy-links treat soft links like regular files -H, --hard-links preserve hard links -p, --perms preserve permissions -o, --owner preserve owner (root only) @@ -38,6 +40,7 @@ -t, --times preserve times -S, --sparse handle sparse files efficiently -n, --dry-run show what would have been transferred +-W, --whole-file copy whole files, no incremental checks -x, --one-file-system don't cross filesystem boundaries -B, --block-size SIZE checksum blocking size -e, --rsh COMMAND specify rsh replacement diff -u -r --new-file --exclude=CVS rsync-1.6.6/config.h.in rsync-1.6.7/config.h.in --- rsync-1.6.6/config.h.in Tue Dec 16 03:27:01 1997 +++ rsync-1.6.7/config.h.in Wed Dec 17 11:10:22 1997 @@ -62,6 +62,7 @@ #undef HAVE_MEMMOVE #undef HAVE_MMAP #undef HAVE_LCHOWN +#undef HAVE_SETLINEBUF /* specific programs */ #undef HAVE_REMSH @@ -86,6 +87,10 @@ /* Define as the return type of signal handlers (int or void). */ #undef RETSIGTYPE + +/* pgrp info */ +#undef GETPGRP_VOID +#undef SETPGRP_VOID /* Define if you can safely include both and . */ diff -u -r --new-file --exclude=CVS rsync-1.6.6/configure rsync-1.6.7/configure --- rsync-1.6.6/configure Tue Dec 16 09:11:17 1997 +++ rsync-1.6.7/configure Wed Dec 17 11:10:22 1997 @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.9 +# Generated automatically using autoconf version 2.12 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -49,6 +49,8 @@ # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 ac_prev= for ac_option @@ -330,7 +332,7 @@ verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.9" + echo "configure generated by autoconf version 2.12" exit 0 ;; -with-* | --with-*) @@ -432,11 +434,14 @@ done # NLS nuisances. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h @@ -498,6 +503,7 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. @@ -517,6 +523,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:527: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -545,6 +552,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:556: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -591,7 +599,47 @@ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:604: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:638: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:643: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -600,7 +648,7 @@ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:604: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:652: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -608,33 +656,38 @@ fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + if test $ac_cv_prog_gcc = yes; then GCC=yes - if test "${CFLAGS+set}" != set; then - echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:667: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_gcc_g=yes + ac_cv_prog_cc_g=yes else - ac_cv_prog_gcc_g=no + ac_cv_prog_cc_g=no fi rm -f conftest* fi -echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6 - if test $ac_cv_prog_gcc_g = yes; then - CFLAGS="-g -O" - else - CFLAGS="-O" - fi +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" fi else GCC= - test "${CFLAGS+set}" = set || CFLAGS="-g -O" + test "${CFLAGS+set}" = set || CFLAGS="-g" fi ac_aux_dir= @@ -667,11 +720,12 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:724: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in @@ -694,7 +748,7 @@ ;; esac done - IFS="$ac_save_ifs" + IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then @@ -720,6 +774,7 @@ # Extract the first word of "remsh", so it can be a program name with args. set dummy remsh; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:778: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_HAVE_REMSH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -753,34 +808,35 @@ ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do -ac_safe=`echo "$ac_hdr" | tr './\055' '___'` +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 +echo "configure:814: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> -int main() { return 0; } -int t() { +int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:772: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:827: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=no" fi rm -f conftest* - fi if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdedfghijklmnopqrstuvwxyz./\055' 'ABCDEDFGHIJKLMNOPQRSTUVWXYZ___'` + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 -ac_lib_var=`echo dir_opendir | tr '.-/+' '___p'` +echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 +echo "configure:852: checking for opendir in -ldir" >&5 +ac_lib_var=`echo dir'_'opendir | 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 ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi @@ -828,28 +888,32 @@ fi else -echo $ac_n "checking for -lx""... $ac_c" 1>&6 -ac_lib_var=`echo x_opendir | tr '.-/+' '___p'` +echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 +echo "configure:893: checking for opendir in -lx" >&5 +ac_lib_var=`echo x'_'opendir | 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 ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi @@ -867,29 +931,30 @@ fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 +echo "configure:935: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include -int main() { return 0; } -int t() { +int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:885: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:949: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_time=no fi rm -f conftest* - fi echo "$ac_t""$ac_cv_header_time" 1>&6 @@ -901,11 +966,12 @@ fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 +echo "configure:970: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -915,22 +981,22 @@ #ifndef WIFEXITED #define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif -int main() { return 0; } -int t() { +int main() { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:926: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:991: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_sys_wait_h=no fi rm -f conftest* - fi echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 @@ -942,6 +1008,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:1012: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -956,33 +1023,37 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:966: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:981: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1050: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi @@ -999,24 +1070,27 @@ for ac_hdr in sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h unistd.h utime.h grp.h do -ac_safe=`echo "$ac_hdr" | tr './\055' '___'` +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1076: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1014: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1086: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi @@ -1024,7 +1098,7 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 +echo "configure:1116: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1051: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1126: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi @@ -1061,7 +1138,7 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 +echo "configure:1156: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1088: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1166: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi @@ -1098,7 +1178,7 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 -if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - ac_cv_c_cross=yes -else -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then - ac_cv_c_cross=no -else - ac_cv_c_cross=yes -fi -fi -rm -fr conftest* -fi - -echo "$ac_t""$ac_cv_c_cross" 1>&6 -cross_compiling=$ac_cv_c_cross - echo $ac_n "checking size of int""... $ac_c" 1>&6 +echo "configure:1194: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else -cat > conftest.$ac_ext < conftest.$ac_ext < main() @@ -1154,15 +1209,19 @@ exit(0); } EOF -{ (eval echo configure:1158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then +if { (eval echo configure:1213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then ac_cv_sizeof_int=`cat conftestval` else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* ac_cv_sizeof_int=0 fi -fi rm -fr conftest* fi + +fi echo "$ac_t""$ac_cv_sizeof_int" 1>&6 cat >> confdefs.h <&6 +echo "configure:1233: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else -cat > conftest.$ac_ext < conftest.$ac_ext < main() @@ -1188,15 +1248,19 @@ exit(0); } EOF -{ (eval echo configure:1192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then +if { (eval echo configure:1252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then ac_cv_sizeof_long=`cat conftestval` else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* ac_cv_sizeof_long=0 fi -fi rm -fr conftest* fi + +fi echo "$ac_t""$ac_cv_sizeof_long" 1>&6 cat >> confdefs.h <&6 +echo "configure:1272: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else -cat > conftest.$ac_ext < conftest.$ac_ext < main() @@ -1222,15 +1287,19 @@ exit(0); } EOF -{ (eval echo configure:1226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then +if { (eval echo configure:1291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then ac_cv_sizeof_short=`cat conftestval` else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* ac_cv_sizeof_short=0 fi -fi rm -fr conftest* fi + +fi echo "$ac_t""$ac_cv_sizeof_short" 1>&6 cat >> confdefs.h <&6 +echo "configure:1312: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1326: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 fi rm -f conftest* - done fi @@ -1278,11 +1349,12 @@ echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 +echo "configure:1353: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1295,20 +1367,20 @@ void (*signal ()) (); #endif -int main() { return 0; } -int t() { +int main() { int i; ; return 0; } EOF -if { (eval echo configure:1304: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1375: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_type_signal=int fi rm -f conftest* - fi echo "$ac_t""$ac_cv_type_signal" 1>&6 @@ -1318,11 +1390,12 @@ echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 +echo "configure:1394: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -1351,11 +1424,12 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:1428: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1363,13 +1437,15 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1367: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1441: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yes else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_stdc=no fi @@ -1378,7 +1454,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1396,7 +1472,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1416,8 +1492,8 @@ if test "$cross_compiling" = yes; then : else -cat > conftest.$ac_ext < conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1428,15 +1504,19 @@ exit (0); } EOF -{ (eval echo configure:1432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then +if { (eval echo configure:1508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then : else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* ac_cv_header_stdc=no fi -fi rm -fr conftest* fi + +fi fi echo "$ac_t""$ac_cv_header_stdc" 1>&6 @@ -1448,19 +1528,21 @@ fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 +echo "configure:1532: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include +#include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "mode_t" >/dev/null 2>&1; then + egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_mode_t=yes else @@ -1479,19 +1561,21 @@ fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 +echo "configure:1565: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include +#include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "off_t" >/dev/null 2>&1; then + egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_off_t=yes else @@ -1510,19 +1594,21 @@ fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 +echo "configure:1598: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include +#include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "size_t" >/dev/null 2>&1; then + egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_size_t=yes else @@ -1541,19 +1627,21 @@ fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 +echo "configure:1631: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include +#include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "pid_t" >/dev/null 2>&1; then + egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_pid_t=yes else @@ -1572,28 +1660,29 @@ fi echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6 +echo "configure:1664: checking for st_rdev in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include -int main() { return 0; } -int t() { +int main() { struct stat s; s.st_rdev; ; return 0; } EOF -if { (eval echo configure:1589: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1677: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_rdev=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_struct_st_rdev=no fi rm -f conftest* - fi echo "$ac_t""$ac_cv_struct_st_rdev" 1>&6 @@ -1605,19 +1694,21 @@ fi echo $ac_n "checking for ino_t""... $ac_c" 1>&6 +echo "configure:1698: checking for ino_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ino_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include +#include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "ino_t" >/dev/null 2>&1; then + egrep "ino_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_ino_t=yes else @@ -1638,36 +1729,37 @@ echo $ac_n "checking for errno in errno.h... $ac_c" cat > conftest.$ac_ext < -int main() { return 0; } -int t() { +int main() { int i = errno ; return 0; } EOF -if { (eval echo configure:1650: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1740: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo yes; cat >> confdefs.h <<\EOF #define HAVE_ERRNO_DECL 1 EOF else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* echo no fi rm -f conftest* - echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_memcmp'+set}'`\" = set"; then +echo "configure:1755: 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=no + ac_cv_func_memcmp_clean=no else -cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then - ac_cv_func_memcmp=yes -else - ac_cv_func_memcmp=no -fi +if { (eval echo configure:1773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./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 -echo "$ac_t""$ac_cv_func_memcmp" 1>&6 -test $ac_cv_func_memcmp = no && LIBOBJS="$LIBOBJS memcmp.o" +fi + +echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 +test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o" -for ac_func in valloc getpagesize +for ac_hdr in unistd.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1794: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1804: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1833: 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 < /* 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() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -1719,16 +1857,18 @@ ; return 0; } EOF -if { (eval echo configure:1723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* 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_func_$ac_func=no" fi rm -f 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'` @@ -1742,94 +1882,170 @@ done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_mmap'+set}'`\" = set"; then +echo "configure:1886: checking for working mmap" >&5 +if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then - ac_cv_func_mmap=no + ac_cv_func_mmap_fixed_mapped=no else -cat > conftest.$ac_ext < conftest.$ac_ext < #include #include +/* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE -# include -# ifdef EXEC_PAGESIZE -# define getpagesize() EXEC_PAGESIZE -# else -# ifdef NBPG -# define getpagesize() NBPG * CLSIZE -# ifndef CLSIZE -# define CLSIZE 1 -# endif -# else -# ifdef NBPC -# define getpagesize() NBPC -# else -# define getpagesize() PAGESIZE /* SVR4 */ -# endif -# endif +# ifdef HAVE_UNISTD_H +# include # endif -#endif -#ifndef HAVE_VALLOC -# define valloc malloc -#endif +/* Assume that all systems that can run configure have sys/param.h. */ +# ifndef HAVE_SYS_PARAM_H +# define HAVE_SYS_PARAM_H 1 +# endif + +# ifdef _SC_PAGESIZE +# define getpagesize() sysconf(_SC_PAGESIZE) +# else /* no _SC_PAGESIZE */ +# ifdef HAVE_SYS_PARAM_H +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else /* no EXEC_PAGESIZE */ +# ifdef NBPG +# define getpagesize() NBPG * CLSIZE +# ifndef CLSIZE +# define CLSIZE 1 +# endif /* no CLSIZE */ +# else /* no NBPG */ +# ifdef NBPC +# define getpagesize() NBPC +# else /* no NBPC */ +# ifdef PAGESIZE +# define getpagesize() PAGESIZE +# endif /* PAGESIZE */ +# endif /* no NBPC */ +# endif /* no NBPG */ +# endif /* no EXEC_PAGESIZE */ +# else /* no HAVE_SYS_PARAM_H */ +# define getpagesize() 8192 /* punt totally */ +# endif /* no HAVE_SYS_PARAM_H */ +# endif /* no _SC_PAGESIZE */ + +#endif /* no HAVE_GETPAGESIZE */ #ifdef __cplusplus -extern "C" { void *valloc(unsigned), *malloc(unsigned); } +extern "C" { void *malloc(unsigned); } #else -char *valloc(), *malloc(); +char *malloc(); #endif int main() { - char *buf1, *buf2, *buf3; - int i = getpagesize(), j; - int i2 = i * 2; - int fd; - - buf1 = (char *)valloc(i2); - buf2 = (char *)valloc(i); - buf3 = (char *)malloc(i2); - for (j = 0; j < i2; ++j) - *(buf1 + j) = rand(); - fd = open("conftestmmap", O_CREAT | O_RDWR, 0666); - write(fd, buf1, i2); - mmap(buf2, i, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE, fd, 0); - for (j = 0; j < i; ++j) - if (*(buf1 + j) != *(buf2 + j)) - exit(1); - lseek(fd, (long)i, 0); - read(fd, buf2, i); /* read into mapped memory -- file should not change */ - /* (it does in i386 SVR4.0 - Jim Avera, jima@netcom.com) */ - lseek(fd, (long)0, 0); - read(fd, buf3, i2); - for (j = 0; j < i2; ++j) - if (*(buf1 + j) != *(buf3 + j)) - exit(1); - exit(0); + char *data, *data2, *data3; + int i, pagesize; + int fd; + + pagesize = getpagesize(); + + /* + * First, make a file with some known garbage in it. + */ + data = malloc(pagesize); + if (!data) + exit(1); + for (i = 0; i < pagesize; ++i) + *(data + i) = rand(); + umask(0); + fd = creat("conftestmmap", 0600); + if (fd < 0) + exit(1); + if (write(fd, data, pagesize) != pagesize) + exit(1); + close(fd); + + /* + * Next, try to mmap the file at a fixed address which + * already has something else allocated at it. If we can, + * also make sure that we see the same garbage. + */ + fd = open("conftestmmap", O_RDWR); + if (fd < 0) + exit(1); + data2 = malloc(2 * pagesize); + if (!data2) + exit(1); + data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); + if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + exit(1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + exit(1); + + /* + * Finally, make sure that changes to the mapped area + * do not percolate back to the file as seen by read(). + * (This is a bug on some variants of i386 svr4.0.) + */ + for (i = 0; i < pagesize; ++i) + *(data2 + i) = *(data2 + i) + 1; + data3 = malloc(pagesize); + if (!data3) + exit(1); + if (read(fd, data3, pagesize) != pagesize) + exit(1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + exit(1); + close(fd); + unlink("conftestmmap"); + exit(0); } EOF -{ (eval echo configure:1822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then - ac_cv_func_mmap=yes -else - ac_cv_func_mmap=no -fi +if { (eval echo configure:2034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + ac_cv_func_mmap_fixed_mapped=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_func_mmap_fixed_mapped=no fi rm -fr conftest* fi -echo "$ac_t""$ac_cv_func_mmap" 1>&6 -if test $ac_cv_func_mmap = yes; then +fi + +echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6 +if test $ac_cv_func_mmap_fixed_mapped = yes; then cat >> confdefs.h <<\EOF #define HAVE_MMAP 1 EOF @@ -1837,6 +2053,7 @@ fi echo $ac_n "checking whether utime accepts a null argument""... $ac_c" 1>&6 +echo "configure:2057: 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 @@ -1845,8 +2062,8 @@ if test "$cross_compiling" = yes; then ac_cv_func_utime_null=no else -cat > conftest.$ac_ext < conftest.$ac_ext < #include @@ -1857,14 +2074,18 @@ && t.st_mtime - s.st_mtime < 120)); } EOF -{ (eval echo configure:1861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then +if { (eval echo configure:2078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./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 -fi rm -fr conftest* +fi + rm -f core core.* *.core fi @@ -1876,23 +2097,160 @@ fi +echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 +echo "configure:2102: checking whether setpgrp takes no argument" >&5 +if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + ac_cv_func_setpgrp_void=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_func_setpgrp_void=yes +fi +rm -fr conftest* +fi + + +fi + +echo "$ac_t""$ac_cv_func_setpgrp_void" 1>&6 +if test $ac_cv_func_setpgrp_void = yes; then + cat >> confdefs.h <<\EOF +#define SETPGRP_VOID 1 +EOF + +fi + +echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 +echo "configure:2150: checking whether getpgrp takes no argument" >&5 +if eval "test \"`echo '$''{'ac_cv_func_getpgrp_void'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + { echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext < +#include + +int pid; +int pg1, pg2, pg3, pg4; +int ng, np, s, child; + +main() +{ + pid = getpid(); + pg1 = getpgrp(0); + pg2 = getpgrp(); + pg3 = getpgrp(pid); + pg4 = getpgrp(1); + + /* + * If all of these values are the same, it's pretty sure that + * we're on a system that ignores getpgrp's first argument. + */ + if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3) + exit(0); + + child = fork(); + if (child < 0) + exit(1); + else if (child == 0) { + np = getpid(); + /* + * If this is Sys V, this will not work; pgrp will be + * set to np because setpgrp just changes a pgrp to be + * the same as the pid. + */ + setpgrp(np, pg1); + ng = getpgrp(0); /* Same result for Sys V and BSD */ + if (ng == pg1) { + exit(1); + } else { + exit(0); + } + } else { + wait(&s); + exit(s>>8); + } +} + +EOF +if { (eval echo configure:2213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + ac_cv_func_getpgrp_void=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_func_getpgrp_void=no +fi +rm -fr conftest* +fi + + +fi + +echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6 +if test $ac_cv_func_getpgrp_void = yes; then + cat >> confdefs.h <<\EOF +#define GETPGRP_VOID 1 +EOF + +fi + for ac_func in waitpid strtok pipe getcwd mkdir strdup strerror chown chmod mknod do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2239: 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 < /* 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() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -1905,16 +2263,18 @@ ; return 0; } EOF -if { (eval echo configure:1909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* 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_func_$ac_func=no" fi rm -f 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'` @@ -1930,20 +2290,22 @@ for ac_func in fchmod fstat strchr bcopy bzero readlink link utime utimes do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2294: 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 < /* 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() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -1956,16 +2318,18 @@ ; return 0; } EOF -if { (eval echo configure:1960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* 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_func_$ac_func=no" fi rm -f 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'` @@ -1978,23 +2342,25 @@ fi done -for ac_func in memmove getopt_long lchown +for ac_func in memmove getopt_long lchown setlinebuf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2349: 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 < /* 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() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -2007,16 +2373,18 @@ ; return 0; } EOF -if { (eval echo configure:2011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* 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_func_$ac_func=no" fi rm -f 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'` @@ -2034,23 +2402,27 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else -cat > conftest.$ac_ext < conftest.$ac_ext < main() { exit(fnmatch("*.o", "x.o", 0) == 0? 0: 1); } EOF -{ (eval echo configure:2044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then +if { (eval echo configure:2412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then echo yes;cat >> confdefs.h <<\EOF #define HAVE_FNMATCH 1 EOF else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* echo no fi -fi rm -fr conftest* +fi + trap '' 1 2 15 cat > confcache <<\EOF @@ -2069,11 +2441,25 @@ # --recheck option to rerun configure. # EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | - sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \ - >> confcache + case `(ac_space=' '; set) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache if cmp -s $cache_file confcache; then : else @@ -2128,7 +2514,7 @@ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.9" + echo "$CONFIG_STATUS generated by autoconf version 2.12" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -2179,20 +2565,56 @@ CEOF EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile]", defaulting infile="outfile.in". + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac - # Adjust relative srcdir, etc. for subdirectories. + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` @@ -2220,6 +2642,7 @@ [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac + echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." @@ -2228,14 +2651,16 @@ # $configure_input" ;; *) ac_comsub= ;; esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g -" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done -rm -f conftest.subs +rm -f conftest.s* # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. @@ -2256,11 +2681,17 @@ ac_eC=' ' ac_eD='%g' -CONFIG_HEADERS=${CONFIG_HEADERS-"config.h"} +if test "${CONFIG_HEADERS+set}" != set; then +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +fi for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile]", defaulting infile="outfile.in". + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac @@ -2268,7 +2699,8 @@ echo creating $ac_file rm -f conftest.frag conftest.in conftest.out - cp $ac_given_srcdir/$ac_file_in conftest.in + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + cat $ac_file_inputs > conftest.in EOF @@ -2296,8 +2728,6 @@ # Break up conftest.vals because some shells have a limit on # the size of here documents, and old seds have small limits too. -# Maximum number of lines to put in a single here document. -ac_max_here_lines=12 rm -f conftest.tail while : @@ -2328,12 +2758,22 @@ echo "$ac_file is unchanged" rm -f conftest.h else + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + fi rm -f $ac_file mv conftest.h $ac_file fi fi; done +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF exit 0 EOF diff -u -r --new-file --exclude=CVS rsync-1.6.6/configure.in rsync-1.6.7/configure.in --- rsync-1.6.6/configure.in Tue Dec 16 03:27:04 1997 +++ rsync-1.6.7/configure.in Wed Dec 17 11:10:22 1997 @@ -40,9 +40,11 @@ AC_FUNC_MEMCMP AC_FUNC_MMAP AC_FUNC_UTIME_NULL +AC_FUNC_SETPGRP +AC_FUNC_GETPGRP AC_CHECK_FUNCS(waitpid strtok pipe getcwd mkdir strdup strerror chown chmod mknod) AC_CHECK_FUNCS(fchmod fstat strchr bcopy bzero readlink link utime utimes) -AC_CHECK_FUNCS(memmove getopt_long lchown) +AC_CHECK_FUNCS(memmove getopt_long lchown setlinebuf) echo $ac_n "checking for working fnmatch... $ac_c" AC_TRY_RUN([#include diff -u -r --new-file --exclude=CVS rsync-1.6.6/cvs.log rsync-1.6.7/cvs.log --- rsync-1.6.6/cvs.log Tue Dec 16 18:20:16 1997 +++ rsync-1.6.7/cvs.log Wed Dec 17 11:19:11 1997 @@ -364,3 +364,95 @@ Log Message: preparing for release of 1.6.6 + +**************************************** +Date: Tuesday December 16, 1997 @ 20:29 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv25958 + +Modified Files: + rsync.c +Log Message: +fixed a bug in the handling of the new --relative option. The file was +being opened twice but closed once. The process eventually died with +an out of file descriptors error. + + + +**************************************** +Date: Tuesday December 16, 1997 @ 22:40 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv7370 + +Modified Files: + Makefile.in config.h.in configure configure.in flist.c main.c +Log Message: +- check for setlinebuf() in autoconf. Apparently HPUX doesn't have it + +- use @exec_prefix@ and @prefix@ in more useful ways in Makefile.in + + + + +**************************************** +Date: Tuesday December 16, 1997 @ 23:09 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv18186 + +Modified Files: + flist.c main.c rsync.c rsync.h +Log Message: +handle things more grecefully when one machine supports hard links and +the other doesn't or one machine supports soft links and the other +doesn't. + + + +**************************************** +Date: Wednesday December 17, 1997 @ 11:07 +Author: tridge + +Update of /data/cvs/rsync +In directory samba:/tmp/cvs-serv15387 + +Modified Files: + README config.h.in configure configure.in flist.c hlink.c + main.c proto.h rsync.1 rsync.c rsync.h +Log Message: + +A set of patches from Christopher Chan-Nui . + +- better cleanup in case of error conditions. rsync now uses setpgrp() +to put all processes in one group then on a fatal error condition +(such as out of disk space) it will kill all members of this group + +- added -L (--copy-links) option. With this option symbolic links and +treated like ordinary files. + +- added -W (--whole-file) option. This option disables the normal +rsync incremental algorithm, making rsync send all data. Useful when +both source and destination are local + + + + + + +**************************************** +Date: Wednesday December 17, 1997 @ 11:19 +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 1.6.7 + diff -u -r --new-file --exclude=CVS rsync-1.6.6/flist.c rsync-1.6.7/flist.c --- rsync-1.6.6/flist.c Tue Dec 16 18:14:44 1997 +++ rsync-1.6.7/flist.c Wed Dec 17 11:10:22 1997 @@ -42,12 +42,26 @@ extern int preserve_gid; extern int preserve_times; extern int relative_paths; +extern int copy_links; static char **local_exclude_list = NULL; static void clean_fname(char *name); +int link_stat(const char *Path, struct stat *Buffer) +{ +#if SUPPORT_LINKS + if (copy_links) { + return stat(Path, Buffer); + } else { + return lstat(Path, Buffer); + } +#else + return stat(Path, Buffer); +#endif +} + /* This function is used to check if a file should be included/excluded from the list of files based on its name and type etc @@ -68,7 +82,7 @@ static void set_filesystem(char *fname) { struct stat st; - if (lstat(fname,&st) != 0) return; + if (link_stat(fname,&st) != 0) return; filesystem_dev = st.st_dev; } @@ -187,7 +201,7 @@ bzero((char *)file,sizeof(*file)); file->name = (char *)malloc(l1+l2+1); - if (!file->name) out_of_memory("receive_file_entry"); + if (!file->name) out_of_memory("receive_file_entry 1"); strncpy(file->name,lastname,l1); read_buf(f,file->name+l1,l2); @@ -203,15 +217,13 @@ if (preserve_devices && IS_DEVICE(file->mode)) file->rdev = (flags & SAME_RDEV) ? last_rdev : (dev_t)read_int(f); -#if SUPPORT_LINKS if (preserve_links && S_ISLNK(file->mode)) { int l = read_int(f); file->link = (char *)malloc(l+1); - if (!file->link) out_of_memory("receive_file_entry"); + if (!file->link) out_of_memory("receive_file_entry 2"); read_buf(f,file->link,l); file->link[l] = 0; } -#endif #if SUPPORT_HARD_LINKS if (preserve_hard_links && S_ISREG(file->mode)) { @@ -243,7 +255,7 @@ bzero(sum,SUM_LENGTH); - if (lstat(fname,&st) != 0) { + if (link_stat(fname,&st) != 0) { fprintf(FERROR,"%s: %s\n", fname,strerror(errno)); return NULL; @@ -418,7 +430,7 @@ strcat(fname,"."); } - if (lstat(fname,&st) != 0) { + if (link_stat(fname,&st) != 0) { fprintf(FERROR,"%s : %s\n",fname,strerror(errno)); continue; } diff -u -r --new-file --exclude=CVS rsync-1.6.6/hlink.c rsync-1.6.7/hlink.c --- rsync-1.6.6/hlink.c Tue Dec 16 09:09:28 1997 +++ rsync-1.6.7/hlink.c Wed Dec 17 11:10:22 1997 @@ -116,8 +116,8 @@ hlink_list[i].inode == hlink_list[i-1].inode) { struct stat st1,st2; - if (lstat(hlink_list[i-1].name,&st1) != 0) continue; - if (lstat(hlink_list[i].name,&st2) != 0) { + if (link_stat(hlink_list[i-1].name,&st1) != 0) continue; + if (link_stat(hlink_list[i].name,&st2) != 0) { if (!dry_run && link(hlink_list[i-1].name,hlink_list[i].name) != 0) { if (verbose > 0) fprintf(FINFO,"link %s => %s : %s\n", diff -u -r --new-file --exclude=CVS rsync-1.6.6/main.c rsync-1.6.7/main.c --- rsync-1.6.6/main.c Mon Dec 15 23:05:07 1997 +++ rsync-1.6.7/main.c Wed Dec 17 11:10:22 1997 @@ -30,6 +30,8 @@ static char *rsync_path = RSYNC_NAME; int make_backups = 0; +int whole_file = 0; +int copy_links = 0; int preserve_links = 0; int preserve_hard_links = 0; int preserve_perms = 0; @@ -115,6 +117,10 @@ argstr[x++] = 'n'; if (preserve_links) argstr[x++] = 'l'; + if (copy_links) + argstr[x++] = 'L'; + if (whole_file) + argstr[x++] = 'W'; if (preserve_hard_links) argstr[x++] = 'H'; if (preserve_uid) @@ -163,8 +169,8 @@ int do_cmd(char *cmd,char *machine,char *user,char *path,int *f_in,int *f_out) { char *args[100]; - int i,argc=0; - char *tok,*p; + int i,argc=0, ret; + char *tok,*p,*dir=NULL; if (!local_server) { if (!cmd) @@ -200,7 +206,7 @@ server_options(args,&argc); if (path && *path) { - char *dir = strdup(path); + dir = strdup(path); p = strrchr(dir,'/'); if (p && !relative_paths) { *p = 0; @@ -226,7 +232,10 @@ fprintf(FERROR,"\n"); } - return piped_child(args,f_in,f_out); + ret = piped_child(args,f_in,f_out); + if (dir) free(dir); + + return ret; oom: out_of_memory("do_cmd"); @@ -404,6 +413,7 @@ fprintf(f,"-b, --backup make backups (default ~ extension)\n"); fprintf(f,"-u, --update update only (don't overwrite newer files)\n"); fprintf(f,"-l, --links preserve soft links\n"); + fprintf(f,"-L, --copy-links treat soft links like regular files\n"); fprintf(f,"-H, --hard-links preserve hard links\n"); fprintf(f,"-p, --perms preserve permissions\n"); fprintf(f,"-o, --owner preserve owner (root only)\n"); @@ -412,6 +422,7 @@ fprintf(f,"-t, --times preserve times\n"); fprintf(f,"-S, --sparse handle sparse files efficiently\n"); fprintf(f,"-n, --dry-run show what would have been transferred\n"); + fprintf(f,"-W, --whole-file copy whole files, no incremental checks\n"); fprintf(f,"-x, --one-file-system don't cross filesystem boundaries\n"); fprintf(f,"-B, --block-size SIZE checksum blocking size\n"); fprintf(f,"-e, --rsh COMMAND specify rsh replacement\n"); @@ -433,7 +444,7 @@ enum {OPT_VERSION,OPT_SUFFIX,OPT_SENDER,OPT_SERVER,OPT_EXCLUDE, OPT_EXCLUDE_FROM,OPT_DELETE,OPT_RSYNC_PATH}; -static char *short_options = "oblHpguDCtcahvrRIxnSe:B:z"; +static char *short_options = "oblLWHpguDCtcahvrRIxnSe:B:z"; static struct option long_options[] = { {"version", 0, 0, OPT_VERSION}, @@ -459,6 +470,8 @@ {"devices", 0, 0, 'D'}, {"perms", 0, 0, 'p'}, {"links", 0, 0, 'l'}, + {"copy-links", 0, 0, 'L'}, + {"whole-file", 0, 0, 'W'}, {"hard-links", 0, 0, 'H'}, {"owner", 0, 0, 'o'}, {"group", 0, 0, 'g'}, @@ -469,6 +482,10 @@ {"compress", 0, 0, 'z'}, {0,0,0,0}}; +RETSIGTYPE sigusr1_handler(int val) { + exit_cleanup(1); +} + int main(int argc,char *argv[]) { int pid, status = 0, status2 = 0; @@ -483,6 +500,13 @@ struct file_list *flist; char *local_name = NULL; +#ifdef SETPGRP_VOID + setpgrp(); +#else + setpgrp(0,0); +#endif + signal(SIGUSR1, sigusr1_handler); + starttime = time(NULL); am_root = (getuid() == 0); @@ -553,14 +577,23 @@ break; case 'l': -#if SUPPORT_LINKS preserve_links=1; -#endif + break; + + case 'L': + copy_links=1; + break; + + case 'W': + whole_file=1; break; case 'H': #if SUPPORT_HARD_LINKS preserve_hard_links=1; +#else + fprintf(FERROR,"ERROR: hard links not supported on this platform\n"); + exit_cleanup(1); #endif break; @@ -657,6 +690,13 @@ if (dry_run) verbose = MAX(verbose,1); +#ifndef SUPPORT_LINKS + if (!am_server && preserve_links) { + fprintf(FERROR,"ERROR: symbolic links not supported\n"); + exit_cleanup(1); + } +#endif + if (am_server) { setup_protocol(STDOUT_FILENO,STDIN_FILENO); @@ -730,8 +770,10 @@ setup_protocol(f_out,f_in); +#if HAVE_SETLINEBUF setlinebuf(FINFO); setlinebuf(FERROR); +#endif if (verbose > 3) fprintf(FERROR,"parent=%d child=%d sender=%d recurse=%d\n", @@ -771,3 +813,4 @@ return status | status2; } + diff -u -r --new-file --exclude=CVS rsync-1.6.6/proto.h rsync-1.6.7/proto.h --- rsync-1.6.6/proto.h Tue Dec 16 01:43:30 1997 +++ rsync-1.6.7/proto.h Wed Dec 17 11:10:22 1997 @@ -19,6 +19,7 @@ void send_exclude_list(int f); void recv_exclude_list(int f); void add_cvs_excludes(void); +int link_stat(const char *Path, struct stat *Buffer) ; void send_file_entry_v11(struct file_struct *file,int f); void receive_file_entry_v11(struct file_struct *file, unsigned char flags,int f); diff -u -r --new-file --exclude=CVS rsync-1.6.6/rsync.1 rsync-1.6.7/rsync.1 --- rsync-1.6.6/rsync.1 Mon Dec 15 21:35:52 1997 +++ rsync-1.6.7/rsync.1 Wed Dec 17 11:10:22 1997 @@ -8,6 +8,10 @@ rsync [options] path [user@]host:path +OR + + rsync [options] path path + .SH DESCRIPTION rsync is a program that behaves in much the same way that rcp does, but has many more options and uses the rsync remote-update protocol to @@ -51,11 +55,10 @@ .SH USAGE You use rsync in the same way you use rcp. You must specify a source -and a destination, one of which must be remote. +and a destination, one of which may be remote. Perhaps the best way to explain the syntax is some examples: - rsync *.c foo:src/ this would transfer all files matching the pattern *.c from the @@ -202,6 +205,12 @@ are skipped. .RE +.B -L, --copy-links +.RS 3 +This tells rsync to treat symbolic links just like ordinary +files. +.RE + .B -H, --hard-links .RS 3 This tells rsync to recreate hard links on the remote system to be @@ -210,6 +219,15 @@ Note that rsync can only detect hard links if both parts of the link are in the list of files being sent. + +This option can be quite slow, so only use it if you need it. +.RE + +.B -W, --whole-file +.RS 3 +With this option the incremental rsync algorithm is not used and the +whole file is sent as-is instead. This may be useful when using rsync +with a local machine. .RE .B -p, --perms diff -u -r --new-file --exclude=CVS rsync-1.6.6/rsync.c rsync-1.6.7/rsync.c --- rsync-1.6.6/rsync.c Tue Dec 16 18:14:44 1997 +++ rsync-1.6.7/rsync.c Wed Dec 17 11:10:22 1997 @@ -30,6 +30,7 @@ extern char *backup_suffix; +extern int whole_file; extern int block_size; extern int update_only; extern int make_backups; @@ -200,7 +201,7 @@ if (dry_run) return 0; if (!st) { - if (lstat(fname,&st2) != 0) { + if (link_stat(fname,&st2) != 0) { fprintf(FERROR,"stat %s : %s\n",fname,strerror(errno)); return 0; } @@ -264,7 +265,7 @@ if (verbose > 2) fprintf(FERROR,"recv_generator(%s,%d)\n",fname,i); - statret = lstat(fname,&st); + statret = link_stat(fname,&st); if (S_ISDIR(file->mode)) { if (dry_run) return; @@ -288,8 +289,8 @@ return; } -#if SUPPORT_LINKS if (preserve_links && S_ISLNK(file->mode)) { +#if SUPPORT_LINKS char lnk[MAXPATHLEN]; int l; if (statret == 0) { @@ -312,9 +313,9 @@ fprintf(FINFO,"%s -> %s\n", fname,file->link); } +#endif return; } -#endif #ifdef HAVE_MKNOD if (am_root && preserve_devices && IS_DEVICE(file->mode)) { @@ -404,6 +405,12 @@ return; } + if (whole_file) { + write_int(f_out,i); + send_sums(NULL,f_out); + return; + } + /* open the file */ fd = open(fname,O_RDONLY); @@ -533,7 +540,6 @@ static void delete_files(struct file_list *flist) { struct file_list *local_file_list; - char *dot="."; int i, j; char *last_name=NULL; @@ -566,9 +572,17 @@ void exit_cleanup(int code) { - if (cleanup_fname) - unlink(cleanup_fname); - exit(code); + if (cleanup_fname) + unlink(cleanup_fname); + signal(SIGUSR1, SIG_IGN); + if (code) { +#ifdef GETPGRP_VOID + kill(-getpgrp(), SIGUSR1); +#else + kill(-getpgrp(getpid()), SIGUSR1); +#endif + } + exit(code); } void sig_int(void) @@ -656,6 +670,7 @@ /* open tmp file */ if (strlen(fname) > (MAXPATHLEN-8)) { fprintf(FERROR,"filename too long\n"); + close(fd1); continue; } sprintf(fnametmp,"%s.XXXXXX",fname); @@ -667,7 +682,7 @@ continue; } fd2 = open(fnametmp,O_WRONLY|O_CREAT,file->mode); - if (relative_paths && errno == ENOENT && + if (fd2 == -1 && relative_paths && errno == ENOENT && create_directory_path(fnametmp) == 0) { fd2 = open(fnametmp,O_WRONLY|O_CREAT,file->mode); } @@ -817,6 +832,7 @@ /* map the local file */ if (fstat(fd,&st) != 0) { fprintf(FERROR,"fstat failed : %s\n",strerror(errno)); + close(fd); return -1; } diff -u -r --new-file --exclude=CVS rsync-1.6.6/rsync.h rsync-1.6.7/rsync.h --- rsync-1.6.6/rsync.h Mon Dec 15 18:35:12 1997 +++ rsync-1.6.7/rsync.h Wed Dec 17 11:10:22 1997 @@ -163,6 +163,9 @@ #include "lib/getopt.h" #endif +#ifndef S_IFLNK +#define S_IFLNK 0120000 +#endif #ifndef S_ISLNK #define S_ISLNK(mode) (((mode) & S_IFLNK) == S_IFLNK) @@ -287,16 +290,8 @@ #define bzero(buf,n) memset(buf,0,n) #endif -#define SUPPORT_LINKS (HAVE_READLINK && defined(S_ISLNK)) +#define SUPPORT_LINKS HAVE_READLINK #define SUPPORT_HARD_LINKS HAVE_LINK - -#ifndef S_ISLNK -#define S_ISLNK(x) 0 -#endif - -#if !SUPPORT_LINKS -#define lstat stat -#endif #ifndef HAVE_LCHOWN #define lchown chown diff -u -r --new-file --exclude=CVS rsync-1.6.6/version.h rsync-1.6.7/version.h --- rsync-1.6.6/version.h Tue Dec 16 18:20:08 1997 +++ rsync-1.6.7/version.h Wed Dec 17 11:18:59 1997 @@ -1 +1 @@ -#define VERSION "1.6.6" +#define VERSION "1.6.7"