]> andersk Git - gssapi-openssh.git/blobdiff - openssh/openbsd-compat/xmmap.c
merged OpenSSH 4.7p1 to trunk
[gssapi-openssh.git] / openssh / openbsd-compat / xmmap.c
index d136a3447b087d2a0340901db4cc9fb8ee35cad7..322ffc2b17f6d9c2eec19a17d80468d67ba3083a 100644 (file)
 
 #include "includes.h"
 
+#include <sys/types.h>
 #ifdef HAVE_SYS_MMAN_H
 #include <sys/mman.h>
 #endif
+#include <sys/stat.h>
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+#include <errno.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 
 #include "log.h"
 
-void *xmmap(size_t size)
+void *
+xmmap(size_t size)
 {
+#ifdef HAVE_MMAP
        void *address;
 
-#ifdef HAVE_MMAP
 # ifdef MAP_ANON
        address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED,
            -1, (off_t)0);
@@ -47,7 +59,7 @@ void *xmmap(size_t size)
 # endif
 
 #define MM_SWAP_TEMPLATE "/var/run/sshd.mm.XXXXXXXX"
-       if (address == MAP_FAILED) {
+       if (address == (void *)MAP_FAILED) {
                char tmpname[sizeof(MM_SWAP_TEMPLATE)] = MM_SWAP_TEMPLATE;
                int tmpfd;
                mode_t old_umask;
This page took 0.061628 seconds and 4 git commands to generate.