From: Jérémie Galarneau Date: Wed, 7 Apr 2021 15:55:26 +0000 (-0400) Subject: Fix: sessiond: kernel: invalid error code check X-Git-Tag: v2.11.7~20 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=fd5f765ddad09f7f0395544bfa2b4ea5f624966a;p=lttng-tools.git Fix: sessiond: kernel: invalid error code check The `EEXIST` error code does not make sense for a kernctl_disable() operation. In fact, not existing would be an error. Signed-off-by: Jérémie Galarneau Change-Id: I8f66c6d6769a4a10e8ff446736c6a7d55a9c32be --- diff --git a/src/bin/lttng-sessiond/kernel.c b/src/bin/lttng-sessiond/kernel.c index cff8fb25b..7795cad33 100644 --- a/src/bin/lttng-sessiond/kernel.c +++ b/src/bin/lttng-sessiond/kernel.c @@ -660,14 +660,8 @@ int kernel_disable_event(struct ltt_kernel_event *event) ret = kernctl_disable(event->fd); if (ret < 0) { - switch (-ret) { - case EEXIST: - ret = LTTNG_ERR_KERN_EVENT_EXIST; - break; - default: - PERROR("disable kernel event"); - break; - } + PERROR("Failed to disable kernel event: name = '%s', fd = %d", + event->event->name, event->fd); goto error; }