summaryrefslogtreecommitdiff
path: root/openbsd-compat
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-compat')
-rw-r--r--openbsd-compat/.cvsignore1
-rw-r--r--openbsd-compat/bsd-poll.c5
-rw-r--r--openbsd-compat/port-uw.c4
-rw-r--r--openbsd-compat/xcrypt.c2
-rw-r--r--openbsd-compat/xmmap.c5
5 files changed, 9 insertions, 8 deletions
diff --git a/openbsd-compat/.cvsignore b/openbsd-compat/.cvsignore
deleted file mode 100644
index f3c7a7c5d..000000000
--- a/openbsd-compat/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
1Makefile
diff --git a/openbsd-compat/bsd-poll.c b/openbsd-compat/bsd-poll.c
index 284db3a1f..f899d7a24 100644
--- a/openbsd-compat/bsd-poll.c
+++ b/openbsd-compat/bsd-poll.c
@@ -1,4 +1,4 @@
1/* $Id: bsd-poll.c,v 1.3 2008/04/04 05:16:36 djm Exp $ */ 1/* $Id: bsd-poll.c,v 1.4 2008/08/29 21:32:38 dtucker Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2004, 2005, 2007 Darren Tucker (dtucker at zip com au). 4 * Copyright (c) 2004, 2005, 2007 Darren Tucker (dtucker at zip com au).
@@ -46,11 +46,12 @@ poll(struct pollfd *fds, nfds_t nfds, int timeout)
46 struct timeval tv, *tvp = NULL; 46 struct timeval tv, *tvp = NULL;
47 47
48 for (i = 0; i < nfds; i++) { 48 for (i = 0; i < nfds; i++) {
49 fd = fds[i].fd;
49 if (fd >= FD_SETSIZE) { 50 if (fd >= FD_SETSIZE) {
50 errno = EINVAL; 51 errno = EINVAL;
51 return -1; 52 return -1;
52 } 53 }
53 maxfd = MAX(maxfd, fds[i].fd); 54 maxfd = MAX(maxfd, fd);
54 } 55 }
55 56
56 nmemb = howmany(maxfd + 1 , NFDBITS); 57 nmemb = howmany(maxfd + 1 , NFDBITS);
diff --git a/openbsd-compat/port-uw.c b/openbsd-compat/port-uw.c
index ebc229a6a..be9905a6a 100644
--- a/openbsd-compat/port-uw.c
+++ b/openbsd-compat/port-uw.c
@@ -25,7 +25,7 @@
25 25
26#include "includes.h" 26#include "includes.h"
27 27
28#ifdef HAVE_LIBIAF 28#if defined(HAVE_LIBIAF) && !defined(HAVE_SECUREWARE)
29#include <sys/types.h> 29#include <sys/types.h>
30#ifdef HAVE_CRYPT_H 30#ifdef HAVE_CRYPT_H
31# include <crypt.h> 31# include <crypt.h>
@@ -145,5 +145,5 @@ get_iaf_password(struct passwd *pw)
145 fatal("ia_openinfo: Unable to open the shadow passwd file"); 145 fatal("ia_openinfo: Unable to open the shadow passwd file");
146} 146}
147#endif /* USE_LIBIAF */ 147#endif /* USE_LIBIAF */
148#endif /* HAVE_LIBIAF */ 148#endif /* HAVE_LIBIAF and not HAVE_SECUREWARE */
149 149
diff --git a/openbsd-compat/xcrypt.c b/openbsd-compat/xcrypt.c
index d8636bb39..6291e2884 100644
--- a/openbsd-compat/xcrypt.c
+++ b/openbsd-compat/xcrypt.c
@@ -28,7 +28,7 @@
28#include <unistd.h> 28#include <unistd.h>
29#include <pwd.h> 29#include <pwd.h>
30 30
31# ifdef HAVE_CRYPT_H 31# if defined(HAVE_CRYPT_H) && !defined(HAVE_SECUREWARE)
32# include <crypt.h> 32# include <crypt.h>
33# endif 33# endif
34 34
diff --git a/openbsd-compat/xmmap.c b/openbsd-compat/xmmap.c
index 23efe3888..04c6babc2 100644
--- a/openbsd-compat/xmmap.c
+++ b/openbsd-compat/xmmap.c
@@ -23,7 +23,7 @@
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26/* $Id: xmmap.c,v 1.14 2007/06/11 02:52:24 djm Exp $ */ 26/* $Id: xmmap.c,v 1.15 2009/02/16 04:21:40 djm Exp $ */
27 27
28#include "includes.h" 28#include "includes.h"
29 29
@@ -71,7 +71,8 @@ xmmap(size_t size)
71 fatal("mkstemp(\"%s\"): %s", 71 fatal("mkstemp(\"%s\"): %s",
72 MM_SWAP_TEMPLATE, strerror(errno)); 72 MM_SWAP_TEMPLATE, strerror(errno));
73 unlink(tmpname); 73 unlink(tmpname);
74 ftruncate(tmpfd, size); 74 if (ftruncate(tmpfd, size) != 0)
75 fatal("%s: ftruncate: %s", __func__, strerror(errno));
75 address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_SHARED, 76 address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_SHARED,
76 tmpfd, (off_t)0); 77 tmpfd, (off_t)0);
77 close(tmpfd); 78 close(tmpfd);