*** empty log message ***
authorAndrew Tridgell <tridge@samba.org>
Tue, 27 Jan 1998 17:51:37 +0000 (17:51 +0000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 27 Jan 1998 17:51:37 +0000 (17:51 +0000)
Makefile.in
configure.in
rsync.h
util.c

index ce49f97..ed0a86a 100644 (file)
@@ -20,7 +20,7 @@ SHELL=/bin/sh
 .SUFFIXES:
 .SUFFIXES: .c .o
 
-LIBOBJ=lib/getopt.o lib/fnmatch.o lib/zlib.o
+LIBOBJ=lib/getopt.o lib/fnmatch.o lib/zlib.o lib/compat.o
 OBJS1=rsync.o exclude.o util.o md4.o main.o checksum.o match.o
 OBJS=$(OBJS1) flist.o io.o compat.o hlink.o token.o uidlist.o $(LIBOBJ)
 
index ade2198..cc161e7 100644 (file)
@@ -52,4 +52,13 @@ main() { exit(fnmatch("*.o", "x.o", 0) == 0? 0: 1); }],
 echo yes;AC_DEFINE(HAVE_FNMATCH), 
 echo no)
 
+echo $ac_n "checking for utimbuf ... $ac_c"
+AC_TRY_COMPILE([#include <sys/types.h>
+#include <utime.h>],
+[int set_modtime(char *fname,time_t modtime)
+{  struct utimbuf tbuf;  tbuf.actime = 0; tbuf.modtime = modtime;
+   return utime(fname,&tbuf); }],
+echo yes;AC_DEFINE(HAVE_UTIMBUF), 
+echo no)
+
 AC_OUTPUT(Makefile)
diff --git a/rsync.h b/rsync.h
index 836c67d..cef172a 100644 (file)
--- a/rsync.h
+++ b/rsync.h
@@ -333,5 +333,21 @@ extern int errno;
 #define S_IWUSR 0200
 #endif
 
+#ifndef S_ISBLK
+#define S_ISBLK(mode) (((mode) & (_S_IFMT)) == (_S_IFBLK))
+#endif
+
+#ifndef S_ISCHR
+#define S_ISCHR(mode) (((mode) & (_S_IFMT)) == (_S_IFCHR))
+#endif
+
+#ifndef S_ISDIR
+#define S_ISDIR(mode) (((mode) & (_S_IFMT)) == (_S_IFDIR))
+#endif
+
+#ifndef S_ISREG
+#define S_ISREG(mode) (((mode) & (_S_IFMT)) == (_S_IFREG))
+#endif
+
 #define IS_DEVICE(mode) (S_ISCHR(mode) || S_ISBLK(mode))
 
diff --git a/util.c b/util.c
index d04a217..2a47945 100644 (file)
--- a/util.c
+++ b/util.c
@@ -164,21 +164,10 @@ void out_of_memory(char *str)
 }
 
 
-#ifndef HAVE_STRDUP
- char *strdup(char *s)
-{
-  int l = strlen(s) + 1;
-  char *ret = (char *)malloc(l);
-  if (ret)
-    strcpy(ret,s);
-  return ret;
-}
-#endif
-
 
 int set_modtime(char *fname,time_t modtime)
 {
-#ifdef HAVE_UTIME_H
+#ifdef HAVE_UTIMBUF
   struct utimbuf tbuf;  
   tbuf.actime = time(NULL);
   tbuf.modtime = modtime;