Version 2.0.8
[lttng-ust.git] / liblttng-ust / lttng-ust-comm.c
index 51eb75b55ab873795356fef5543839c5f44e755f..dece0ee6e70d42ef4982e545884a6f944e550fc8 100644 (file)
@@ -156,14 +156,16 @@ int setup_local_apps(void)
         * Disallow per-user tracing for setuid binaries.
         */
        if (uid != geteuid()) {
-               local_apps.allowed = 0;
+               assert(local_apps.allowed == 0);
                return 0;
-       } else {
-               local_apps.allowed = 1;
        }
        home_dir = (const char *) getenv("HOME");
-       if (!home_dir)
+       if (!home_dir) {
+               WARN("HOME environment variable not set. Disabling LTTng-UST per-user tracing.");
+               assert(local_apps.allowed == 0);
                return -ENOENT;
+       }
+       local_apps.allowed = 1;
        snprintf(local_apps.sock_path, PATH_MAX,
                 DEFAULT_HOME_APPS_UNIX_SOCK, home_dir);
        snprintf(local_apps.wait_shm_path, PATH_MAX,
@@ -549,13 +551,13 @@ int get_wait_shm(struct sock_info *sock_info, size_t mmap_size)
                 */
                if (!sock_info->global && errno != EACCES) {
                        ERR("Error opening shm %s", sock_info->wait_shm_path);
-                       exit(EXIT_FAILURE);
+                       _exit(EXIT_FAILURE);
                }
                /*
                 * The shm exists, but we cannot open it RW. Report
                 * success.
                 */
-               exit(EXIT_SUCCESS);
+               _exit(EXIT_SUCCESS);
        } else {
                return -1;
        }
@@ -891,7 +893,7 @@ void __attribute__((constructor)) lttng_ust_init(void)
 
        ret = setup_local_apps();
        if (ret) {
-               ERR("Error setting up to local apps");
+               DBG("local apps setup returned %d", ret);
        }
 
        /* A new thread created by pthread_create inherits the signal mask
This page took 0.024549 seconds and 4 git commands to generate.