sessiond: Split ust_registry_session into per-type classes
[lttng-tools.git] / src / common / uuid.cpp
index 77b9a767bececffe3210255c9d8c11f1dc9a086d..23672a96fe131f755df81eb357cc7c865619a0da 100644 (file)
@@ -6,7 +6,7 @@
  *
  */
 
-#include <common/compat/string.h>
+#include <common/compat/string.hpp>
 #include <stddef.h>
 #include <stdint.h>
 #include <stdio.h>
@@ -14,7 +14,7 @@
 #include <string.h>
 #include <time.h>
 
-#include "uuid.h"
+#include "uuid.hpp"
 
 static const lttng_uuid nil_uuid = { 0 };
 static bool lttng_uuid_is_init;
@@ -72,10 +72,7 @@ int lttng_uuid_generate(lttng_uuid uuid_out)
 {
        int i, ret = 0;
 
-       if (uuid_out == NULL) {
-               ret = -1;
-               goto end;
-       }
+       LTTNG_ASSERT(uuid_out);
 
        if (!lttng_uuid_is_init) {
                /*
@@ -88,8 +85,8 @@ int lttng_uuid_generate(lttng_uuid uuid_out)
                        ret = -1;
                        goto end;
                }
-               srand(epoch);
 
+               srand(epoch);
                lttng_uuid_is_init = true;
        }
 
This page took 0.022987 seconds and 4 git commands to generate.