]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
handle systems that don't take a 2nd argument to gettimeofday()
authorAndrew Tridgell <tridge@samba.org>
Sun, 23 Jan 2000 02:16:51 +0000 (02:16 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sun, 23 Jan 2000 02:16:51 +0000 (02:16 +0000)
Makefile.in
acconfig.h
authenticate.c
configure.in
lib/compat.c

index 353caa30936866ecce8dcd41ee62d334e02cba51..d401cd7863bb486ba3331cc9216ca479bd96c1ea 100644 (file)
@@ -64,7 +64,7 @@ rsyncd.conf.5: rsyncd.conf.yo
        yodl2man -o rsyncd.conf.5 rsyncd.conf.yo
 
 proto:
-       cat *.c | awk -f mkproto.awk > proto.h
+       cat *.c lib/compat.c | awk -f mkproto.awk > proto.h
 
 clean:
        rm -f *~ $(OBJS) rsync 
index 57522923d29ee91c9fbf2c66dc4e6402b2689f3f..d35ec3fbf72f227bd100cc982c10b4e07812989a 100644 (file)
@@ -10,3 +10,4 @@
 #undef HAVE_SHORT_INO_T
 #undef HAVE_GETOPT_LONG
 #undef REPLACE_INET_NTOA
+#undef HAVE_GETTIMEOFDAY_TZ
index 50c10aaeb18918a1a8cc8f388ba261713e2770d2..f87fceef3505d217c6d64ace5b9aa21f38c3e1b6 100644 (file)
@@ -56,7 +56,7 @@ static void gen_challenge(char *addr, char *challenge)
        memset(input, 0, sizeof(input));
 
        strlcpy((char *)input, addr, 17);
-       gettimeofday(&tv, NULL);
+       sys_gettimeofday(&tv);
        SIVAL(input, 16, tv.tv_sec);
        SIVAL(input, 20, tv.tv_usec);
        SIVAL(input, 24, getpid());
index 80f46508c7816ae1d335d20c7e0bb1e0af0524d4..0257de9d26b6b659fa1bd8bf5d4a3825bb76f58a 100644 (file)
@@ -135,6 +135,17 @@ if test x"$rsync_cv_HAVE_UTIMBUF" = x"yes"; then
     AC_DEFINE(HAVE_UTIMBUF)
 fi
 
+AC_CACHE_CHECK([if gettimeofday takes tz argument],rsync_cv_HAVE_GETTIMEOFDAY_TZ,[
+AC_TRY_RUN([
+#include <sys/time.h>
+#include <unistd.h>
+main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
+           rsync_cv_HAVE_GETTIMEOFDAY_TZ=yes,rsync_cv_HAVE_GETTIMEOFDAY_TZ=no,rsync_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
+if test x"$rsync_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
+    AC_DEFINE(HAVE_GETTIMEOFDAY_TZ)
+fi
+
+
 AC_CACHE_CHECK([for broken inet_ntoa],rsync_cv_REPLACE_INET_NTOA,[
 AC_TRY_RUN([
 #include <stdio.h>
index 8580fdb9c21435cba8f1a39e57f02af43a51d47c..b1e386a074f004f205b1783ed72d89cc1c7a5dbe 100644 (file)
        return 1;
 }
 #endif
+
+/* some systems don't take the 2nd argument */
+int sys_gettimeofday(struct timeval *tv)
+{
+#if HAVE_GETTIMEOFDAY_TZ
+       return gettimeofday(tv, NULL);
+#else
+       return gettimeofday(tv);
+#endif
+}