From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id CFFC4198005 for ; Mon, 25 Feb 2013 04:08:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 38C8EE068F; Mon, 25 Feb 2013 04:08:16 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A330AE04ED for ; Mon, 25 Feb 2013 04:08:15 +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 B446233DD3E for ; Mon, 25 Feb 2013 04:08:14 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 42B27E4075 for ; Mon, 25 Feb 2013 04:08:13 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1361765105.c8118ad3af11dce5f67d595b3784c5010c764579.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: c8118ad3af11dce5f67d595b3784c5010c764579 X-VCS-Branch: master Date: Mon, 25 Feb 2013 04:08:13 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 889749c7-4f82-4d53-a9c6-72fe3d0b8192 X-Archives-Hash: 8e481ecd0bec4ece5c5c143dfc283752 commit: c8118ad3af11dce5f67d595b3784c5010c764579 Author: Mike Frysinger gentoo org> AuthorDate: Tue Dec 25 05:58:56 2012 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Mon Feb 25 04:05:05 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sandbox.git;a=commit;h=c8118ad3 libsandbox: add some likely/unlikely settings Signed-off-by: Mike Frysinger gentoo.org> --- libsandbox/libsandbox.c | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-) diff --git a/libsandbox/libsandbox.c b/libsandbox/libsandbox.c index 184fc0b..bdef2d9 100644 --- a/libsandbox/libsandbox.c +++ b/libsandbox/libsandbox.c @@ -821,7 +821,7 @@ static int check_syscall(sbcontext_t *sbcontext, int sb_nr, const char *func, result = check_access(sbcontext, sb_nr, func, flags, absolute_path, resolved_path); - if (verbose) { + if (unlikely(verbose)) { int sym_len = SB_MAX_STRING_LEN + 1 - strlen(func); if (!result && sbcontext->show_access_violation) sb_eerror("%sACCESS DENIED%s: %s:%*s%s\n", @@ -839,22 +839,20 @@ static int check_syscall(sbcontext_t *sbcontext, int sb_nr, const char *func, else access = true; - if (!access) { + if (unlikely(!access)) { bool worked = write_logfile(log_path, func, file, absolute_path, resolved_path, access); if (!worked && errno) goto error; } - if (debug) { + if (unlikely(debug)) { bool worked = write_logfile(debug_log_path, func, file, absolute_path, resolved_path, access); if (!worked && errno) goto error; } - if (NULL != absolute_path) - free(absolute_path); - if (NULL != resolved_path) - free(resolved_path); + free(absolute_path); + free(resolved_path); errno = old_errno;