Fix: don't start session if no channel
[lttng-tools.git] / src / bin / lttng-sessiond / session.c
index a777b041428443fe856b4e7613920a377e7b494f..07031a30a5c5bc6cf603b84847aac2a866919ede 100644 (file)
@@ -194,6 +194,16 @@ int session_create(char *name, uid_t uid, gid_t gid)
                goto error;
        }
 
+       ret = gethostname(new_session->hostname, sizeof(new_session->hostname));
+       if (ret < 0) {
+               if (errno == ENAMETOOLONG) {
+                       new_session->hostname[sizeof(new_session->hostname) - 1] = '\0';
+               } else {
+                       ret = LTTNG_ERR_FATAL;
+                       goto error;
+               }
+       }
+
        /* Init kernel session */
        new_session->kernel_session = NULL;
        new_session->ust_session = NULL;
This page took 0.022703 seconds and 4 git commands to generate.