From 6dd1782c42ed166c03ba5ac5a033cf1061167510 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 16 Dec 1997 22:39:55 +0000 Subject: [PATCH] - check for setlinebuf() in autoconf. Apparently HPUX doesn't have it - use @exec_prefix@ and @prefix@ in more useful ways in Makefile.in --- Makefile.in | 6 ++++-- configure.in | 2 +- flist.c | 4 ++-- main.c | 2 ++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile.in b/Makefile.in index d144944b..bc623bd9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 --git a/configure.in b/configure.in index ce1b9e3a..3112f0c3 100644 --- a/configure.in +++ b/configure.in @@ -42,7 +42,7 @@ AC_FUNC_MMAP AC_FUNC_UTIME_NULL 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 --git a/flist.c b/flist.c index b333b5be..8a995000 100644 --- a/flist.c +++ b/flist.c @@ -187,7 +187,7 @@ void receive_file_entry_v11(struct file_struct *file, 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); @@ -207,7 +207,7 @@ void receive_file_entry_v11(struct file_struct *file, 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; } diff --git a/main.c b/main.c index 3fbdea11..d289a58a 100644 --- a/main.c +++ b/main.c @@ -730,8 +730,10 @@ int main(int argc,char *argv[]) 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", -- 2.34.1