svn commit: r219482 - head/sbin/hastd
Mikolaj Golub
trociny at FreeBSD.org
Fri Mar 11 12:12:35 UTC 2011
Author: trociny
Date: Fri Mar 11 12:12:35 2011
New Revision: 219482
URL: http://svn.freebsd.org/changeset/base/219482
Log:
Make workers inherit debug level from the main process.
Approved by: pjd (mentor)
MFC after: 1 week
Modified:
head/sbin/hastd/primary.c
head/sbin/hastd/secondary.c
Modified: head/sbin/hastd/primary.c
==============================================================================
--- head/sbin/hastd/primary.c Fri Mar 11 11:58:54 2011 (r219481)
+++ head/sbin/hastd/primary.c Fri Mar 11 12:12:35 2011 (r219482)
@@ -806,7 +806,7 @@ hastd_primary(struct hast_resource *res)
{
pthread_t td;
pid_t pid;
- int error, mode;
+ int error, mode, debuglevel;
/*
* Create communication channel for sending control commands from
@@ -858,6 +858,7 @@ hastd_primary(struct hast_resource *res)
gres = res;
mode = pjdlog_mode_get();
+ debuglevel = pjdlog_debug_get();
/* Declare that we are sender. */
proto_send(res->hr_event, NULL, 0);
@@ -869,6 +870,7 @@ hastd_primary(struct hast_resource *res)
descriptors_assert(res, mode);
pjdlog_init(mode);
+ pjdlog_debug_set(debuglevel);
pjdlog_prefix_set("[%s] (%s) ", res->hr_name, role2str(res->hr_role));
setproctitle("%s (primary)", res->hr_name);
Modified: head/sbin/hastd/secondary.c
==============================================================================
--- head/sbin/hastd/secondary.c Fri Mar 11 11:58:54 2011 (r219481)
+++ head/sbin/hastd/secondary.c Fri Mar 11 12:12:35 2011 (r219482)
@@ -346,7 +346,7 @@ hastd_secondary(struct hast_resource *re
sigset_t mask;
pthread_t td;
pid_t pid;
- int error, mode;
+ int error, mode, debuglevel;
/*
* Create communication channel between parent and child.
@@ -398,6 +398,7 @@ hastd_secondary(struct hast_resource *re
gres = res;
mode = pjdlog_mode_get();
+ debuglevel = pjdlog_debug_get();
/* Declare that we are sender. */
proto_send(res->hr_event, NULL, 0);
@@ -409,6 +410,7 @@ hastd_secondary(struct hast_resource *re
descriptors_assert(res, mode);
pjdlog_init(mode);
+ pjdlog_debug_set(debuglevel);
pjdlog_prefix_set("[%s] (%s) ", res->hr_name, role2str(res->hr_role));
setproctitle("%s (secondary)", res->hr_name);
More information about the svn-src-head
mailing list