From: David Goulet Date: Wed, 5 Oct 2011 22:40:19 +0000 (-0400) Subject: Fix disable event X-Git-Tag: v2.0-pre15~190 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f84efadf55274918ca038a4e06e0a8af1a320654;p=lttng-tools.git Fix disable event Signed-off-by: David Goulet --- diff --git a/liblttngctl/lttngctl.c b/liblttngctl/lttngctl.c index 0442a4f02..4c4cf80d3 100644 --- a/liblttngctl/lttngctl.c +++ b/liblttngctl/lttngctl.c @@ -541,7 +541,7 @@ int lttng_disable_event(struct lttng_handle *handle, const char *name, copy_lttng_domain(&lsm.domain, &handle->domain); - if (name == NULL) { + if (name != NULL) { copy_string(lsm.u.disable.name, name, sizeof(lsm.u.disable.name)); lsm.cmd_type = LTTNG_DISABLE_EVENT; } else { diff --git a/lttng/commands/disable_events.c b/lttng/commands/disable_events.c index b4d5ecb04..f30a2b28a 100644 --- a/lttng/commands/disable_events.c +++ b/lttng/commands/disable_events.c @@ -86,7 +86,6 @@ static int disable_events(char *session_name) { int err, ret = CMD_SUCCESS; char *event_name, *channel_name = NULL; - struct lttng_event ev; struct lttng_domain dom; if (opt_channel_name == NULL) { @@ -126,9 +125,6 @@ static int disable_events(char *session_name) DBG("Disabling kernel event %s for channel %s", event_name, channel_name); - /* Copy name and type of the event */ - strncpy(ev.name, event_name, LTTNG_SYMBOL_NAME_LEN); - ev.name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0'; ret = lttng_disable_event(handle, event_name, channel_name); if (ret < 0) { MSG("Unable to disable event %s for channel %s",