Revert "Fix: sessiond: erroneous user check logic in session_access_ok"
[lttng-tools.git] / src / bin / lttng-consumerd / lttng-consumerd.c
index fef03c6f64c44060637934ceb5e873198ed70b80..bd53db5897d3861b42da7e43f8d86b046027ee10 100644 (file)
@@ -1,19 +1,9 @@
 /*
- * Copyright (C) 2011 Julien Desfossez <julien.desfossez@polymtl.ca>
- *                      Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * Copyright (C) 2011 Julien Desfossez <julien.desfossez@polymtl.ca>
+ * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2 only,
- * as published by the Free Software Foundation.
+ * SPDX-License-Identifier: GPL-2.0-only
  *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #define _LGPL_SOURCE
@@ -252,7 +242,7 @@ static int parse_args(int argc, char **argv)
                        lttng_opt_quiet = 1;
                        break;
                case 'v':
-                       lttng_opt_verbose = 1;
+                       lttng_opt_verbose = 3;
                        break;
                case 'V':
                        fprintf(stdout, "%s\n", VERSION);
@@ -311,6 +301,10 @@ int main(int argc, char **argv)
 
        rcu_register_thread();
 
+       if (run_as_create_worker(argv[0], NULL, NULL) < 0) {
+               goto exit_set_signal_handler;
+       }
+
        if (set_signal_handler()) {
                retval = -1;
                goto exit_set_signal_handler;
@@ -411,10 +405,6 @@ int main(int argc, char **argv)
                set_ulimit();
        }
 
-       if (run_as_create_worker(argv[0]) < 0) {
-               goto exit_init_data;
-       }
-
        /* create the consumer instance with and assign the callbacks */
        ctx = lttng_consumer_create(opt_type, lttng_consumer_read_subbuffer,
                NULL, lttng_consumer_on_recv_stream, NULL);
@@ -576,14 +566,6 @@ int main(int argc, char **argv)
                PERROR("pthread_join sessiond_thread");
                retval = -1;
        }
-
-       ret = consumer_timer_thread_get_channel_monitor_pipe();
-       if (ret >= 0) {
-               ret = close(ret);
-               if (ret) {
-                       PERROR("close channel monitor pipe");
-               }
-       }
 exit_sessiond_thread:
 
        ret = pthread_join(data_thread, &status);
@@ -650,6 +632,13 @@ exit_init_data:
                        PERROR("pthread_join metadata_timer_thread");
                        retval = -1;
                }
+               ret = consumer_timer_thread_get_channel_monitor_pipe();
+               if (ret >= 0) {
+                       ret = close(ret);
+                       if (ret) {
+                               PERROR("close channel monitor pipe");
+                       }
+               }
                metadata_timer_thread_online = false;
        }
        tmp_ctx = ctx;
This page took 0.024478 seconds and 4 git commands to generate.