diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-01-27 17:51:37 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-01-27 17:51:37 +0000 |
commit | 1e9f155adea9c9dca7b420749cd8a92203d9427b (patch) | |
tree | 58b08796d077603ea14f981cecc4bba9361008a0 | |
parent | 6bbbc08b83d2d2598a894439a1392c84a67168e2 (diff) | |
download | rsync-1e9f155adea9c9dca7b420749cd8a92203d9427b.tar.gz rsync-1e9f155adea9c9dca7b420749cd8a92203d9427b.tar.bz2 rsync-1e9f155adea9c9dca7b420749cd8a92203d9427b.zip |
*** empty log message ***
-rw-r--r-- | Makefile.in | 2 | ||||
-rw-r--r-- | configure.in | 9 | ||||
-rw-r--r-- | rsync.h | 16 | ||||
-rw-r--r-- | util.c | 13 |
4 files changed, 27 insertions, 13 deletions
diff --git a/Makefile.in b/Makefile.in index ce49f976..ed0a86a4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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) diff --git a/configure.in b/configure.in index ade21982..cc161e7c 100644 --- a/configure.in +++ b/configure.in @@ -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) @@ -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)) @@ -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; |