Add utils.c and recursive mkdir function
[lttng-tools.git] / ltt-sessiond / main.c
index 2fcd923a1897d0f58b2b2f53568c83b2f526162d..b0848eb45bb2fdb8cb4df223cf9b2e794e1a0a4b 100644 (file)
@@ -48,6 +48,7 @@
 #include "traceable-app.h"
 #include "lttng-kconsumerd.h"
 #include "libustctl.h"
 #include "traceable-app.h"
 #include "lttng-kconsumerd.h"
 #include "libustctl.h"
+#include "utils.h"
 
 /*
  * TODO:
 
 /*
  * TODO:
@@ -282,12 +283,10 @@ static int create_trace_dir(struct ltt_kernel_session *session)
        /* Create all channel directories */
        cds_list_for_each_entry(chan, &session->channel_list.head, list) {
                DBG("Creating trace directory at %s", chan->pathname);
        /* Create all channel directories */
        cds_list_for_each_entry(chan, &session->channel_list.head, list) {
                DBG("Creating trace directory at %s", chan->pathname);
-               // TODO: recursive create dir
-               ret = mkdir(chan->pathname, S_IRWXU | S_IRWXG );
+               ret = mkdir_recursive(chan->pathname, S_IRWXU | S_IRWXG );
                if (ret < 0) {
                        if (ret != EEXIST) {
                if (ret < 0) {
                        if (ret != EEXIST) {
-                               perror("mkdir trace path");
-                               ret = -errno;
+                               ERR("Trace directory creation error");
                                goto error;
                        }
                }
                                goto error;
                        }
                }
This page took 0.022918 seconds and 4 git commands to generate.