From f72154b33e67069cd7c308d24255574b9fbacb1d Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 24 Apr 2008 13:55:19 -0400 Subject: PR6451: avoid one class of staprun shutdown deadlock (module/.ctl filehandle = 0) --- runtime/staprun/ChangeLog | 6 ++++++ runtime/staprun/common.c | 2 +- runtime/staprun/ctl.c | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'runtime') diff --git a/runtime/staprun/ChangeLog b/runtime/staprun/ChangeLog index f1abd736..9e0ccb73 100644 --- a/runtime/staprun/ChangeLog +++ b/runtime/staprun/ChangeLog @@ -1,3 +1,9 @@ +2008-04-24 Frank Ch. Eigler + + PR 6451. + * common.c (control_channel): Initialize to -1. + * ctl.c (close_ctl_channel): Tolerate fd=0. + 2008-04-22 Martin Hunt * cap.c (init_cap): Detect capabilities failure and diff --git a/runtime/staprun/common.c b/runtime/staprun/common.c index f8fc418c..b716d27f 100644 --- a/runtime/staprun/common.c +++ b/runtime/staprun/common.c @@ -31,7 +31,7 @@ char *modname = NULL; char *modpath = ""; char *modoptions[MAXMODOPTIONS]; -int control_channel = 0; +int control_channel = -1; /* NB: fd==0 possible */ void parse_args(int argc, char **argv) { diff --git a/runtime/staprun/ctl.c b/runtime/staprun/ctl.c index 15c5c3d3..4597bf72 100644 --- a/runtime/staprun/ctl.c +++ b/runtime/staprun/ctl.c @@ -46,8 +46,8 @@ int init_ctl_channel(const char *name, int verb) void close_ctl_channel(void) { - if (control_channel > 0) { + if (control_channel >= 0) { close(control_channel); - control_channel = 0; + control_channel = -1; } } -- cgit