Change in libosmocore[master]: logging_vty.c: Avoid acquiring log tgt lock in logging level cmd when...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Fri Jan 3 22:16:08 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/16697 )

Change subject: logging_vty.c: Avoid acquiring log tgt lock in logging level cmd when not needed
......................................................................

logging_vty.c: Avoid acquiring log tgt lock in logging level cmd when not needed

Change-Id: Ia6780221174070cee408625e24513f2c11cc9dfc
---
M src/vty/logging_vty.c
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  fixeria: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index 6d908d9..c51b437 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -351,18 +351,18 @@
 	int category = log_parse_category(argv[0]);
 	int level = log_parse_level(argv[1]);
 
-	ACQUIRE_VTY_LOG_TGT_WITH_LOCK(vty, tgt);
-
 	if (level < 0) {
 		vty_out(vty, "Invalid level `%s'%s", argv[1], VTY_NEWLINE);
-		RET_WITH_UNLOCK(CMD_WARNING);
+		return CMD_WARNING;
 	}
 
 	if (category < 0) {
 		vty_out(vty, "Invalid category `%s'%s", argv[0], VTY_NEWLINE);
-		RET_WITH_UNLOCK(CMD_WARNING);
+		return CMD_WARNING;
 	}
 
+	ACQUIRE_VTY_LOG_TGT_WITH_LOCK(vty, tgt);
+
 	tgt->categories[category].enabled = 1;
 	tgt->categories[category].loglevel = level;
 

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/16697
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia6780221174070cee408625e24513f2c11cc9dfc
Gerrit-Change-Number: 16697
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200103/139029d7/attachment.htm>


More information about the gerrit-log mailing list