Note: Due to technical difficulties, the Archives are currently not up to date.
GMANE provides an alternative service for most mailing lists. c.f. bug 424647
List Archive: gentoo-commits
commit: 1860d33fc9c9d05907db9bf02f1c81e0f517c09f
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 7 05:25:41 2012 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Mar 7 05:28:01 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sandbox.git;a=commit;h=1860d33f
libsandbox: add missing close to logfile fd
When we log a lot, we end up leaking fd's, so make sure to clean them.
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>
---
libsandbox/libsandbox.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/libsandbox/libsandbox.c b/libsandbox/libsandbox.c
index 77a2415..e0b291a 100644
--- a/libsandbox/libsandbox.c
+++ b/libsandbox/libsandbox.c
@@ -468,6 +468,7 @@ static bool write_logfile(const char *logfile, const char *func, const char *pat
struct stat log_stat;
int stat_ret;
int logfd;
+ bool ret = false;
stat_ret = lstat(logfile, &log_stat);
/* Do not care about failure */
@@ -523,10 +524,12 @@ static bool write_logfile(const char *logfile, const char *func, const char *pat
}
_SB_WRITE_STR("\n");
- return true;
+ ret = true;
error:
- return false;
+ sb_close(logfd);
+
+ return ret;
}
static void init_context(sbcontext_t *context)
|
|