[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 04/15: libfshelp: Avoid useless allocations.
From: |
Samuel Thibault |
Subject: |
[hurd] 04/15: libfshelp: Avoid useless allocations. |
Date: |
Sun, 19 Nov 2017 15:27:05 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch dde
in repository hurd.
commit 978a819485e1e301c49b41fb629656d157d61ec6
Author: Justus Winter <address@hidden>
Date: Wed Oct 5 15:07:37 2016 +0200
libfshelp: Avoid useless allocations.
* libfshelp/translator-list.c (fshelp_set_active_translator): Avoid
allocating an entry unless a valid control port is given.
---
libfshelp/translator-list.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libfshelp/translator-list.c b/libfshelp/translator-list.c
index c730ecd..5203128 100644
--- a/libfshelp/translator-list.c
+++ b/libfshelp/translator-list.c
@@ -89,6 +89,10 @@ fshelp_set_active_translator (struct port_info *pi,
if (t)
goto update; /* Entry exists. */
+ if (! MACH_PORT_VALID (active))
+ /* Avoid allocating an entry just to delete it. */
+ goto out;
+
t = malloc (sizeof *t);
if (! t)
{
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] branch dde updated (4d4175c -> e3c726d), Samuel Thibault, 2017/11/19
- [hurd] 04/15: libfshelp: Avoid useless allocations.,
Samuel Thibault <=
- [hurd] 05/15: libfshelp: Always register dead-name notifications., Samuel Thibault, 2017/11/19
- [hurd] 07/15: Normalize path of translators., Samuel Thibault, 2017/11/19
- [hurd] 09/15: libfshelp: Avoid some right diddling., Samuel Thibault, 2017/11/19
- [hurd] 08/15: libfshelp: Improve error handling., Samuel Thibault, 2017/11/19
- [hurd] 12/15: libdiskfs: Shutdown pagers on startup_dosync., Samuel Thibault, 2017/11/19
- [hurd] 10/15: libfshelp: Use node instead of name as key., Samuel Thibault, 2017/11/19
- [hurd] 06/15: libfshelp: Add function to map over all active translators., Samuel Thibault, 2017/11/19
- [hurd] 02/15: libfshelp: improve translator list, Samuel Thibault, 2017/11/19
- [hurd] 01/15: pflocal: Use default stub implementations., Samuel Thibault, 2017/11/19
- [hurd] 15/15: Merge branch 'dde-upstream' into dde, Samuel Thibault, 2017/11/19