Clean-up: declare dummy pipe payload as a char instead of a string
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 9 Aug 2019 18:00:22 +0000 (14:00 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 9 Aug 2019 21:57:02 +0000 (17:57 -0400)
Only the first byte of the 'dummy' string is used. Hence, a single
char can be used.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/rotation-thread.c

index aaa2129419cf76d092c4e4b397669c44e7efc99b..cb06413b64c371e1dd9dc7fc384872530092501e 100644 (file)
@@ -216,7 +216,7 @@ void rotation_thread_enqueue_job(struct rotation_thread_timer_queue *queue,
                struct ltt_session *session)
 {
        int ret;
-       const char * const dummy = "!";
+       const char dummy = '!';
        struct rotation_thread_job *job = NULL;
        const char *job_type_str = get_job_type_str(job_type);
 
@@ -242,8 +242,8 @@ void rotation_thread_enqueue_job(struct rotation_thread_timer_queue *queue,
        job->type = job_type;
        cds_list_add_tail(&job->head, &queue->list);
 
-       ret = lttng_write(lttng_pipe_get_writefd(queue->event_pipe), dummy,
-                       1);
+       ret = lttng_write(lttng_pipe_get_writefd(queue->event_pipe), &dummy,
+                       sizeof(dummy));
        if (ret < 0) {
                /*
                 * We do not want to block in the timer handler, the job has
This page took 0.034445 seconds and 4 git commands to generate.