aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorMikolaj Golub <trociny@FreeBSD.org>2011-03-11 12:12:35 +0000
committerMikolaj Golub <trociny@FreeBSD.org>2011-03-11 12:12:35 +0000
commitbc7a916a251c589665225410d5638677e540bcc3 (patch)
treea5378f3cb0e0ca3945defcd6776a3f9da4ec75ba /sbin
parent586b0ae5aa5108477d587a17ca47c9c972c8ce1e (diff)
downloadsrc-bc7a916a251c589665225410d5638677e540bcc3.tar.gz
src-bc7a916a251c589665225410d5638677e540bcc3.zip
Make workers inherit debug level from the main process.
Approved by: pjd (mentor) MFC after: 1 week
Notes
Notes: svn path=/head/; revision=219482
Diffstat (limited to 'sbin')
-rw-r--r--sbin/hastd/primary.c4
-rw-r--r--sbin/hastd/secondary.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/sbin/hastd/primary.c b/sbin/hastd/primary.c
index 8a2065bf7787..6246c710b583 100644
--- a/sbin/hastd/primary.c
+++ b/sbin/hastd/primary.c
@@ -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);
diff --git a/sbin/hastd/secondary.c b/sbin/hastd/secondary.c
index 9c859e080cd7..46fa6f33a661 100644
--- a/sbin/hastd/secondary.c
+++ b/sbin/hastd/secondary.c
@@ -346,7 +346,7 @@ hastd_secondary(struct hast_resource *res, struct nv *nvin)
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 *res, struct nv *nvin)
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 *res, struct nv *nvin)
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);