Fix mkdir error handling
authorDavid Goulet <david.goulet@polymtl.ca>
Tue, 14 Jun 2011 19:51:13 +0000 (15:51 -0400)
committerDavid Goulet <david.goulet@polymtl.ca>
Tue, 14 Jun 2011 19:51:13 +0000 (15:51 -0400)
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
ltt-sessiond/main.c

index 8c113fab3505058014369b592ac1a209b7cae184..98738928464290a8b1406bf21be06e54c26c9b68 100644 (file)
@@ -637,9 +637,11 @@ static int create_trace_dir(struct ltt_kernel_session *session)
                // TODO: recursive create dir
                ret = mkdir(chan->pathname, S_IRWXU | S_IRWXG );
                if (ret < 0) {
-                       perror("mkdir trace path");
-                       ret = -errno;
-                       goto error;
+                       if (ret != EEXIST) {
+                               perror("mkdir trace path");
+                               ret = -errno;
+                               goto error;
+                       }
                }
        }
 
@@ -1514,8 +1516,11 @@ static int set_kconsumerd_sockets(void)
 
        ret = mkdir(KCONSUMERD_PATH, S_IRWXU | S_IRWXG);
        if (ret < 0) {
-               ERR("Failed to create " KCONSUMERD_PATH);
-               goto error;
+               if (errno != EEXIST) {
+                       ERR("Failed to create " KCONSUMERD_PATH);
+                       goto error;
+               }
+               ret = 0;
        }
 
        /* Create the kconsumerd error unix socket */
This page took 0.035044 seconds and 4 git commands to generate.