From: Ian Jackson Date: Wed, 1 Oct 2014 22:42:04 +0000 (+0100) Subject: polypath: Log pid of long-running interface monitor X-Git-Tag: base.ipv6-polypath-fixes.v1~16 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=secnet.git;a=commitdiff_plain;h=83e03cacb4b2380e610b3e86a11b95a295776037;ds=sidebyside polypath: Log pid of long-running interface monitor This new reporting is going to be particularly useful for privsep, which has a child and also a grandchild. Signed-off-by: Ian Jackson --- diff --git a/polypath.c b/polypath.c index b867632..8249207 100644 --- a/polypath.c +++ b/polypath.c @@ -463,7 +463,8 @@ static void child_monitor(struct polypath *st, int childfd) } static void start_subproc(struct polypath *st, void (*make_fdpair)(int[2]), - void (*child)(struct polypath *st, int childfd)) + void (*child)(struct polypath *st, int childfd), + const char *desc) { int pfds[2]; @@ -487,12 +488,15 @@ static void start_subproc(struct polypath *st, void (*make_fdpair)(int[2]), st->monitor_pid=pid; st->monitor_fd=pfds[0]; setnonblock(st->monitor_fd); + + lg_perror(LG,M_NOTICE,0, "%s: spawning %s [pid %ld]", + st->uc.cc.cl.description, desc, (long)st->monitor_pid); } static void polypath_phase_startmonitor(void *sst, uint32_t newphase) { struct polypath *st=sst; - start_subproc(st,pipe_cloexec,child_monitor); + start_subproc(st,pipe_cloexec,child_monitor,"interface monitor"); register_for_poll(st,polypath_beforepoll, polypath_afterpoll_monitor,"polypath"); }