summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-10-02 18:22:48 +0000
committerJeremy Allison <jra@samba.org>2003-10-02 18:22:48 +0000
commit6defe43e6d48619cee31b6c7fc602973e8eeef3f (patch)
tree50db098dab444771de4fb4f456c3cd9db3d1f95b
parent9519ffc7cbdb37a4279c8804230596978679220e (diff)
downloadsamba-6defe43e6d48619cee31b6c7fc602973e8eeef3f.tar.gz
Portability fixes from schmitz@hp.com (Joachim Schmitz). Bug #549.
Jeremy.
-rw-r--r--source/tdb/tdbback.c11
-rw-r--r--source/tdb/tdbbackup.c12
-rw-r--r--source/utils/profiles.c8
3 files changed, 30 insertions, 1 deletions
diff --git a/source/tdb/tdbback.c b/source/tdb/tdbback.c
index 744cface557..9466c299910 100644
--- a/source/tdb/tdbback.c
+++ b/source/tdb/tdbback.c
@@ -18,6 +18,11 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#ifdef STANDALONE
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
@@ -27,10 +32,16 @@
#include <fcntl.h>
#include <time.h>
#include <sys/mman.h>
+
#include <sys/stat.h>
#include <sys/time.h>
#include <ctype.h>
#include <signal.h>
+
+#else
+#include "includes.h"
+#endif
+
#include "tdb.h"
static int failed;
diff --git a/source/tdb/tdbbackup.c b/source/tdb/tdbbackup.c
index 0eaf6b6c0b7..1a0e1c1588f 100644
--- a/source/tdb/tdbbackup.c
+++ b/source/tdb/tdbbackup.c
@@ -41,6 +41,11 @@
*/
+#ifdef STANDALONE
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
@@ -54,6 +59,13 @@
#include <sys/time.h>
#include <ctype.h>
#include <signal.h>
+
+#else
+
+#include "includes.h"
+
+#endif
+
#include "tdb.h"
#include "tdbback.h"
diff --git a/source/utils/profiles.c b/source/utils/profiles.c
index 3230eb21fc8..20b1222e723 100644
--- a/source/utils/profiles.c
+++ b/source/utils/profiles.c
@@ -295,7 +295,6 @@ Hope this helps.... (Although it was "fun" for me to uncover this things,
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
-#include <sys/mman.h>
typedef unsigned int DWORD;
typedef unsigned short WORD;
@@ -610,7 +609,12 @@ int main(int argc, char *argv[])
* dealing with the records. We are interested in the sk record
*/
start = 0;
+
+#ifdef HAVE_MMAP
base = mmap(&start, sbuf.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+#else
+ base = (char *)-1;
+#endif
if ((int)base == -1) {
fprintf(stderr, "Could not mmap file: %s, %s\n", poptPeekArg(pc),
@@ -726,7 +730,9 @@ int main(int argc, char *argv[])
sk_hdr = (SK_HDR *)(base + OFF(IVAL(&sk_hdr->prev_off, 0)));
} while (sk_off != first_sk_off);
+#ifdef HAVE_MMAP
munmap(base, sbuf.st_size);
+#endif
poptFreeContext(pc);