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.12.4~25 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5f09aaf192b1975f219fa900a3d17fe53e7198fe;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 a117575b7..1c584738a 100644 --- a/src/bin/lttng-sessiond/kernel.c +++ b/src/bin/lttng-sessiond/kernel.c @@ -655,14 +655,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; }