[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 43/43: storeio: Avoid calling mmap with zero size
From: |
Samuel Thibault |
Subject: |
[hurd] 43/43: storeio: Avoid calling mmap with zero size |
Date: |
Mon, 11 Sep 2017 07:10:12 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 796f8789f80568861b747265998f31fa83091915
Author: Samuel Thibault <address@hidden>
Date: Mon Sep 11 00:48:17 2017 +0200
storeio: Avoid calling mmap with zero size
* storeio/dev.c (dev_open): When store is zero-sized, set buf to NULL
instead of calling mmap().
---
storeio/dev.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/storeio/dev.c b/storeio/dev.c
index 78e0a17..8bdfa11 100644
--- a/storeio/dev.c
+++ b/storeio/dev.c
@@ -161,8 +161,11 @@ dev_open (struct dev *dev)
to support this. */
store_set_flags (dev->store, STORE_INACTIVE);
- dev->buf = mmap (0, dev->store->block_size, PROT_READ|PROT_WRITE,
- MAP_ANON, 0, 0);
+ if (! dev->store->block_size)
+ dev->buf = NULL;
+ else
+ dev->buf = mmap (0, dev->store->block_size, PROT_READ|PROT_WRITE,
+ MAP_ANON, 0, 0);
if (dev->buf == MAP_FAILED)
{
store_free (dev->store);
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 31/43: ext2fs: Improve inlining., (continued)
- [hurd] 31/43: ext2fs: Improve inlining., Samuel Thibault, 2017/09/11
- [hurd] 08/43: trans/fakeroot: Obey O_NOFOLLOW., Samuel Thibault, 2017/09/11
- [hurd] 35/43: libnetfs: Remove redundant type checks., Samuel Thibault, 2017/09/11
- [hurd] 26/43: eth-multiplexer: Remove local definiton., Samuel Thibault, 2017/09/11
- [hurd] 34/43: libdiskfs: Simplify type checks., Samuel Thibault, 2017/09/11
- [hurd] 16/43: Simplify deallocations., Samuel Thibault, 2017/09/11
- [hurd] 29/43: eth-multiplexer: Respect interfaces up flags., Samuel Thibault, 2017/09/11
- [hurd] 36/43: startup: Don't spin on host_reboot failures., Samuel Thibault, 2017/09/11
- [hurd] 30/43: Drop the register qualifier., Samuel Thibault, 2017/09/11
- [hurd] 02/43: trans: New random translator., Samuel Thibault, 2017/09/11
- [hurd] 43/43: storeio: Avoid calling mmap with zero size,
Samuel Thibault <=
- [hurd] 03/43: trans: Conditionally build the random translator., Samuel Thibault, 2017/09/11
- [hurd] 17/43: Replace bcopy with memcpy or memmove as appropriate., Samuel Thibault, 2017/09/11
- [hurd] 42/43: Fix build with glibc-2.26, Samuel Thibault, 2017/09/11
- [hurd] 39/43: Remove unused parameter from the 'get_source' machinery., Samuel Thibault, 2017/09/11
- [hurd] 37/43: trans/symlink: Use default server stubs., Samuel Thibault, 2017/09/11
- [hurd] 40/43: pfinet: select UDP/TCP ports randomly, Samuel Thibault, 2017/09/11
- [hurd] 15/43: Use our own variant of 'assert' and 'assert_perror'., Samuel Thibault, 2017/09/11