From 00d577a6ab70ad49453097fbab33e5a62498384d Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 11 Oct 2012 23:26:31 -0400 Subject: [PATCH] PR14245: fix staprun->stapio -F passing for -A (attach) mode jistone reported that the recent -F code was not passing on a suitable basedir fd to stapio's forked for re-attach (-A) mode. Make it so. * staprun.c (init_staprun): In attach_mode, do a dummy init_ctl_channel, just to gather a relay_basedir_fd . --- staprun/staprun.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/staprun/staprun.c b/staprun/staprun.c index dd3b1f5a4..b35170bbe 100644 --- a/staprun/staprun.c +++ b/staprun/staprun.c @@ -319,7 +319,12 @@ int init_staprun(void) rc = 0; if (delete_mod) exit(remove_module(modname, 1)); - else if (!attach_mod) { + if (attach_mod) { + /* PR14245: prime the relay_basedir_fd pump. */ + rc = init_ctl_channel (modname, 0); + if (rc >= 0) + close_ctl_channel (); + } else /* if (!attach_mod) */ { if (need_uprobes && enable_uprobes() != 0) return -1; -- 2.43.5