Fix: sessiond: kernel: invalid error code check
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 7 Apr 2021 15:55:26 +0000 (11:55 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 11 May 2021 17:23:53 +0000 (13:23 -0400)
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 <jeremie.galarneau@efficios.com>
Change-Id: I8f66c6d6769a4a10e8ff446736c6a7d55a9c32be

src/bin/lttng-sessiond/kernel.c

index cff8fb25bab198a831a4c5678552dddacbb1386d..7795cad337eb996ee5ea67f1e2bf60a8bf25761b 100644 (file)
@@ -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;
        }
 
This page took 0.026259 seconds and 4 git commands to generate.