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 15:22:06 +0000 (11:22 -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 a117575b74c45ae067ed9ac31fccc6952a3e9fd0..1c584738a2fc4ff29571d42b9e4d64e530919a4e 100644 (file)
@@ -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;
        }
 
This page took 0.027659 seconds and 4 git commands to generate.