Gentoo Logo
Gentoo Spaceship




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
Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-commits@g.o
From: "Mike Frysinger" <vapier@g.o>
Subject: proj/sandbox:master commit in: libsandbox/
Date: Wed, 7 Mar 2012 05:28:24 +0000 (UTC)
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)


Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
proj/sandbox:master commit in: /, libsandbox/
Next by thread:
proj/sandbox:master commit in: libsandbox/
Previous by date:
proj/sandbox:master commit in: /, libsandbox/
Next by date:
gentoo-x86 commit in dev-ruby/test-unit: ChangeLog test-unit-2.4.8.ebuild


Updated Jun 26, 2012

Summary: Archive of the gentoo-commits mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.