summaryrefslogtreecommitdiffstats
path: root/core/apk-tools/fd-leak2.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-06-15 08:32:32 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-06-15 08:32:32 +0000
commit1db6e899072d31a2704533903cfe8f6fab1c98ec (patch)
tree5f32bb8db0fa191097a6031dd0a40be147f4ae30 /core/apk-tools/fd-leak2.patch
parenteb7bedd371a0cacabd9f1b2c628fafb1d42bdbfc (diff)
downloadaports-1.9.0_alpha14.tar.bz2
aports-1.9.0_alpha14.tar.xz
core/apk-tools: fix another fd leak. patch from upstreamv1.9.0_alpha14
Diffstat (limited to 'core/apk-tools/fd-leak2.patch')
-rw-r--r--core/apk-tools/fd-leak2.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/core/apk-tools/fd-leak2.patch b/core/apk-tools/fd-leak2.patch
new file mode 100644
index 00000000..033bc0dc
--- /dev/null
+++ b/core/apk-tools/fd-leak2.patch
@@ -0,0 +1,30 @@
+commit 49c904c993d39cfac7d3373c66f5b910e755f203
+Author: Timo Teras <timo.teras@iki.fi>
+Date: Thu Jun 11 13:03:10 2009 +0300
+
+ io: fix mmap bstream fd leak
+
+ We need to close the fd on destruction. This is what the corresponding
+ istream variant does too.
+
+diff --git a/src/io.c b/src/io.c
+index e0a9c9b..defbe46 100644
+--- a/src/io.c
++++ b/src/io.c
+@@ -4,7 +4,7 @@
+ * Copyright (C) 2008 Timo Teräs <timo.teras@iki.fi>
+ * All rights reserved.
+ *
+- * This program is free software; you can redistribute it and/or modify it
++ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation. See http://www.gnu.org/ for details.
+ */
+@@ -257,6 +257,7 @@ static void mmap_close(void *stream, csum_t csum, size_t *size)
+ *size = mbs->size;
+
+ munmap(mbs->ptr, mbs->size);
++ close(mbs->fd);
+ free(mbs);
+ }
+