X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=doc%2Fexamples%2Frotation%2Frotate-client-example.c;h=a5ee70da326c2181d8133af103e7d83eb57ecc6d;hb=a476c311c901b130ebb98689ac5c9cdae02e1e66;hp=ae641d895040d9f36acad9fc4a97ac9839ea18e7;hpb=95ce9d2952391837f0373449019917eaf54d7bc5;p=lttng-tools.git diff --git a/doc/examples/rotation/rotate-client-example.c b/doc/examples/rotation/rotate-client-example.c index ae641d895..a5ee70da3 100644 --- a/doc/examples/rotation/rotate-client-example.c +++ b/doc/examples/rotation/rotate-client-example.c @@ -42,7 +42,7 @@ static volatile int quit = 0; -static void sighandler(int signal) +static void sighandler(int signal __attribute__((unused))) { printf("Signal caught, exiting\n"); quit = 1; @@ -53,7 +53,7 @@ static int setup_session(const char *session_name, const char *path) int ret; struct lttng_domain dom; struct lttng_event ev; - struct lttng_handle *chan_handle; + struct lttng_handle *chan_handle = NULL; printf("Creating session %s\n", session_name); ret = lttng_create_session(session_name, path); @@ -90,11 +90,10 @@ static int setup_session(const char *session_name, const char *path) goto end; } - lttng_destroy_handle(chan_handle); - ret = 0; end: + lttng_destroy_handle(chan_handle); return ret; }