Got rid of a duplicate include for malloc.h and improved the "do we
authorWayne Davison <wayned@samba.org>
Thu, 21 Aug 2003 23:54:20 +0000 (23:54 +0000)
committerWayne Davison <wayned@samba.org>
Thu, 21 Aug 2003 23:54:20 +0000 (23:54 +0000)
need malloc.h" logic a bit more.  (Trying to prevent #warning and
#error problems on *BSD systems.)

rsync.h

diff --git a/rsync.h b/rsync.h
index 47943f3..3d10af6 100644 (file)
--- a/rsync.h
+++ b/rsync.h
@@ -122,10 +122,10 @@ enum logcode {FNONE=0, FERROR=1, FINFO=2, FLOG=3 };
 
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
-#else
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
 #endif
 #endif
+
+#if defined(HAVE_MALLOC_H) && (defined(HAVE_MALLINFO) || !defined(HAVE_STDLIB_H))
+#include <malloc.h>
 #endif
 
 #ifdef HAVE_SYS_SOCKET_H
 #endif
 
 #ifdef HAVE_SYS_SOCKET_H
@@ -196,10 +196,6 @@ enum logcode {FNONE=0, FERROR=1, FINFO=2, FLOG=3 };
 #include <glob.h>
 #endif
 
 #include <glob.h>
 #endif
 
-#ifdef HAVE_MALLOC_H
-#  include <malloc.h>
-#endif
-
 /* these are needed for the uid/gid mapping code */
 #include <pwd.h>
 #include <grp.h>
 /* these are needed for the uid/gid mapping code */
 #include <pwd.h>
 #include <grp.h>