From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1S59QR-0008MI-EM for garchives@archives.gentoo.org; Wed, 07 Mar 2012 05:28:35 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B5762E060C; Wed, 7 Mar 2012 05:28:26 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 83D7EE060C for ; Wed, 7 Mar 2012 05:28:26 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E38F01B4035 for ; Wed, 7 Mar 2012 05:28:25 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id A519CE542C for ; Wed, 7 Mar 2012 05:28:24 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1331098081.1860d33fc9c9d05907db9bf02f1c81e0f517c09f.vapier@gentoo> Subject: [gentoo-commits] proj/sandbox:master commit in: libsandbox/ X-VCS-Repository: proj/sandbox X-VCS-Files: libsandbox/libsandbox.c X-VCS-Directories: libsandbox/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 1860d33fc9c9d05907db9bf02f1c81e0f517c09f X-VCS-Branch: master Date: Wed, 7 Mar 2012 05:28:24 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: d2d7f45b-2517-4c9d-8e5d-b50f4c073aa2 X-Archives-Hash: 81efdb6618d331fc9e0ab7e0a95e85cf commit: 1860d33fc9c9d05907db9bf02f1c81e0f517c09f Author: Mike Frysinger gentoo org> AuthorDate: Wed Mar 7 05:25:41 2012 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Wed Mar 7 05:28:01 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/sandbox.git;a= =3Dcommit;h=3D1860d33f 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 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 =3D false; =20 stat_ret =3D lstat(logfile, &log_stat); /* Do not care about failure */ @@ -523,10 +524,12 @@ static bool write_logfile(const char *logfile, cons= t char *func, const char *pat } _SB_WRITE_STR("\n"); =20 - return true; + ret =3D true; =20 error: - return false; + sb_close(logfd); + + return ret; } =20 static void init_context(sbcontext_t *context)