summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/openbsd-compat/xmmap.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2009-05-22 18:46:28 +0000
committerdes <des@FreeBSD.org>2009-05-22 18:46:28 +0000
commit8bf56a9772e08d79d1a808bb69be82ca688afc76 (patch)
treed3b23c04145e95d8d26c4e6efa1cd05fa34fd795 /crypto/openssh/openbsd-compat/xmmap.c
parent56fa0af6738b5c4466957197aaa372d30e74440b (diff)
parentf4c3a2131f559534b5693fd15df8d89049db7cbb (diff)
downloadFreeBSD-src-8bf56a9772e08d79d1a808bb69be82ca688afc76.zip
FreeBSD-src-8bf56a9772e08d79d1a808bb69be82ca688afc76.tar.gz
Upgrade to OpenSSH 5.2p1.
MFC after: 3 months
Diffstat (limited to 'crypto/openssh/openbsd-compat/xmmap.c')
-rw-r--r--crypto/openssh/openbsd-compat/xmmap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/openssh/openbsd-compat/xmmap.c b/crypto/openssh/openbsd-compat/xmmap.c
index 23efe38..04c6bab 100644
--- a/crypto/openssh/openbsd-compat/xmmap.c
+++ b/crypto/openssh/openbsd-compat/xmmap.c
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/* $Id: xmmap.c,v 1.14 2007/06/11 02:52:24 djm Exp $ */
+/* $Id: xmmap.c,v 1.15 2009/02/16 04:21:40 djm Exp $ */
#include "includes.h"
@@ -71,7 +71,8 @@ xmmap(size_t size)
fatal("mkstemp(\"%s\"): %s",
MM_SWAP_TEMPLATE, strerror(errno));
unlink(tmpname);
- ftruncate(tmpfd, size);
+ if (ftruncate(tmpfd, size) != 0)
+ fatal("%s: ftruncate: %s", __func__, strerror(errno));
address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_SHARED,
tmpfd, (off_t)0);
close(tmpfd);
OpenPOWER on IntegriCloud