Fix: Mishandled NULL short options in utils_generate_optstring()
[lttng-tools.git] / src / bin / lttng-sessiond / main.c
index 806848c5642bef740835aa6b7dd5872ba18ae553..2b99bbc993e8d9570b4b50744ec139f04926b4eb 100644 (file)
@@ -135,16 +135,16 @@ static struct consumer_data ustconsumer32_data = {
 static const struct option long_options[] = {
        { "client-sock", 1, 0, 'c' },
        { "apps-sock", 1, 0, 'a' },
-       { "kconsumerd-cmd-sock", 1, 0, 'C' },
-       { "kconsumerd-err-sock", 1, 0, 'E' },
-       { "ustconsumerd32-cmd-sock", 1, 0, 'G' },
-       { "ustconsumerd32-err-sock", 1, 0, 'H' },
-       { "ustconsumerd64-cmd-sock", 1, 0, 'D' },
-       { "ustconsumerd64-err-sock", 1, 0, 'F' },
-       { "consumerd32-path", 1, 0, 'u' },
-       { "consumerd32-libdir", 1, 0, 'U' },
-       { "consumerd64-path", 1, 0, 't' },
-       { "consumerd64-libdir", 1, 0, 'T' },
+       { "kconsumerd-cmd-sock", 1, 0, '\0' },
+       { "kconsumerd-err-sock", 1, 0, '\0' },
+       { "ustconsumerd32-cmd-sock", 1, 0, '\0' },
+       { "ustconsumerd32-err-sock", 1, 0, '\0' },
+       { "ustconsumerd64-cmd-sock", 1, 0, '\0' },
+       { "ustconsumerd64-err-sock", 1, 0, '\0' },
+       { "consumerd32-path", 1, 0, '\0' },
+       { "consumerd32-libdir", 1, 0, '\0' },
+       { "consumerd64-path", 1, 0, '\0' },
+       { "consumerd64-libdir", 1, 0, '\0' },
        { "daemonize", 0, 0, 'd' },
        { "background", 0, 0, 'b' },
        { "sig-parent", 0, 0, 'S' },
@@ -153,14 +153,14 @@ static const struct option long_options[] = {
        { "version", 0, 0, 'V' },
        { "quiet", 0, 0, 'q' },
        { "verbose", 0, 0, 'v' },
-       { "verbose-consumer", 0, 0, 'Z' },
-       { "no-kernel", 0, 0, 'N' },
+       { "verbose-consumer", 0, 0, '\0' },
+       { "no-kernel", 0, 0, '\0' },
        { "pidfile", 1, 0, 'p' },
-       { "agent-tcp-port", 1, 0, 'J' },
+       { "agent-tcp-port", 1, 0, '\0' },
        { "config", 1, 0, 'f' },
        { "load", 1, 0, 'l' },
-       { "kmod-probes", 1, 0, 'P' },
-       { "extra-kmod-probes", 1, 0, 'e' },
+       { "kmod-probes", 1, 0, '\0' },
+       { "extra-kmod-probes", 1, 0, '\0' },
        { NULL, 0, 0, 0 }
 };
 
@@ -676,6 +676,9 @@ static void sessiond_cleanup(void)
                }
        }
 
+       DBG("Cleaning up all agent apps");
+       agent_app_ht_clean();
+
        DBG("Closing all UST sockets");
        ust_app_clean_list();
        buffer_reg_destroy_registries();
@@ -5635,9 +5638,12 @@ int main(int argc, char **argv)
                goto exit_init_data;
        }
 
-       /* Initialize agent domain subsystem. */
-       if (agent_setup()) {
-               /* ENOMEM at this point. */
+       /*
+        * Initialize agent app hash table. We allocate the hash table here
+        * since cleanup() can get called after this point.
+        */
+       if (agent_app_ht_alloc()) {
+               ERR("Failed to allocate Agent app hash table");
                retval = -1;
                goto exit_init_data;
        }
This page took 0.025426 seconds and 5 git commands to generate.