summaryrefslogtreecommitdiffstats
path: root/lib/vty.c
diff options
context:
space:
mode:
authorpaulo <paul@bayleaf.org.uk>2009-11-30 17:19:02 +0000
committerpaulo <paul@bayleaf.org.uk>2009-11-30 17:19:02 +0000
commitc1ff9a326120520ea907ab81577d611e179fb87c (patch)
tree7211c45b96da879807d9e4fd07c357089c88e32c /lib/vty.c
parentc207bd104f5ef825c496d3fbfb8393a45882f16f (diff)
downloadquagga-c1ff9a326120520ea907ab81577d611e179fb87c.tar.bz2
quagga-c1ff9a326120520ea907ab81577d611e179fb87c.tar.xz
Make logging (lib.c) and privileges (privs.c) pthread safe
lib.c: use a mutex to protect all public methods. Replaced code in command.c etc that modified zlog_default directly with interlocked getters and setters. Requires that vty_log in vty.c handles its own pthread safety TBA. privs.c: use a mutex to protect all public methods. Counts RAISE and LOWER so that privilege stays RAISED until all pthreads have lowered. Improved messages in test-privs.c
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/vty.c b/lib/vty.c
index 3bf7eb55..7ed2dba7 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -440,10 +440,7 @@ vty_command (struct vty *vty, char *buf)
ret = cmd_execute_command (vline, vty, NULL, 0);
/* Get the name of the protocol if any */
- if (zlog_default)
- protocolname = zlog_proto_names[zlog_default->protocol];
- else
- protocolname = zlog_proto_names[ZLOG_NONE];
+ protocolname = zlog_get_proto_name(NULL);
#ifdef CONSUMED_TIME_CHECK
GETRUSAGE(&after);