Port: replace literal '/' with G_DIR_SEPARATOR
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 6 Jun 2017 18:56:30 +0000 (14:56 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 28 Aug 2017 18:03:49 +0000 (14:03 -0400)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/ctf/fs-sink/write.c
plugins/ctf/fs-src/fs.c
plugins/ctf/fs-src/metadata.c

index 519eb2cb1654560be0785c37b54f3f66df3bc8c2..4b6f6e9ac2e28553afee26b8d4961ad648ba13c6 100644 (file)
@@ -248,7 +248,7 @@ int make_trace_path(struct writer_component *writer_component,
 
        }
 
-       snprintf(trace_path, PATH_MAX, "%s/%s",
+       snprintf(trace_path, PATH_MAX, "%s" G_DIR_SEPARATOR_S "%s",
                        writer_component->base_path->str,
                        trace_name);
        /*
@@ -265,7 +265,7 @@ int make_trace_path(struct writer_component *writer_component,
                        int i = 0;
 
                        do {
-                               snprintf(trace_path, PATH_MAX, "%s/%s-%d",
+                               snprintf(trace_path, PATH_MAX, "%s" G_DIR_SEPARATOR_S "%s-%d",
                                                writer_component->base_path->str,
                                                trace_name, ++i);
                        } while (g_file_test(trace_path, G_FILE_TEST_EXISTS) && i < INT_MAX);
index 32121b7360ec51117e15b93c7941d802018df5c5..d2c0ede31ba4202301fee7149545e61a2ee90b2b 100644 (file)
@@ -782,13 +782,13 @@ int create_ds_file_groups(struct ctf_fs_trace *ctf_fs_trace)
 
                if (!strcmp(basename, CTF_FS_METADATA_FILENAME)) {
                        /* Ignore the metadata stream. */
-                       BT_LOGD("Ignoring metadata file `%s/%s`",
+                       BT_LOGD("Ignoring metadata file `%s" G_DIR_SEPARATOR_S "%s`",
                                ctf_fs_trace->path->str, basename);
                        continue;
                }
 
                if (basename[0] == '.') {
-                       BT_LOGD("Ignoring hidden file `%s/%s`",
+                       BT_LOGD("Ignoring hidden file `%s" G_DIR_SEPARATOR_S "%s`",
                                ctf_fs_trace->path->str, basename);
                        continue;
                }
@@ -796,13 +796,13 @@ int create_ds_file_groups(struct ctf_fs_trace *ctf_fs_trace)
                /* Create the file. */
                file = ctf_fs_file_create();
                if (!file) {
-                       BT_LOGE("Cannot create stream file object for file `%s/%s`",
+                       BT_LOGE("Cannot create stream file object for file `%s" G_DIR_SEPARATOR_S "%s`",
                                ctf_fs_trace->path->str, basename);
                        goto error;
                }
 
                /* Create full path string. */
-               g_string_append_printf(file->path, "%s/%s",
+               g_string_append_printf(file->path, "%s" G_DIR_SEPARATOR_S "%s",
                                ctf_fs_trace->path->str, basename);
                if (!g_file_test(file->path->str, G_FILE_TEST_IS_REGULAR)) {
                        BT_LOGD("Ignoring non-regular file `%s`",
@@ -1004,7 +1004,7 @@ int path_is_ctf_trace(const char *path)
                goto end;
        }
 
-       g_string_printf(metadata_path, "%s/%s", path, CTF_FS_METADATA_FILENAME);
+       g_string_printf(metadata_path, "%s" G_DIR_SEPARATOR_S "%s", path, CTF_FS_METADATA_FILENAME);
 
        if (g_file_test(metadata_path->str, G_FILE_TEST_IS_REGULAR)) {
                ret = 1;
@@ -1029,6 +1029,7 @@ int add_trace_path(GList **trace_paths, const char *path)
                goto end;
        }
 
+       // FIXME: Remove or ifdef for __MINGW32__
        if (strcmp(norm_path->str, "/") == 0) {
                BT_LOGE("Opening a trace in `/` is not supported.");
                ret = -1;
@@ -1098,7 +1099,7 @@ int ctf_fs_find_traces(GList **trace_paths, const char *start_path)
                        goto end;
                }
 
-               g_string_printf(sub_path, "%s/%s", start_path, basename);
+               g_string_printf(sub_path, "%s" G_DIR_SEPARATOR_S "%s", start_path, basename);
                ret = ctf_fs_find_traces(trace_paths, sub_path->str);
                g_string_free(sub_path, TRUE);
                if (ret) {
index 6ae43df90212d7773d3bf26d0902ff92a62bfe2b..cdc38debbaf4b2fd27bdaef2d0c546911be08ae8 100644 (file)
@@ -51,7 +51,7 @@ FILE *ctf_fs_metadata_open_file(const char *trace_path)
                goto end;
        }
 
-       g_string_append(metadata_path, "/" CTF_FS_METADATA_FILENAME);
+       g_string_append(metadata_path, G_DIR_SEPARATOR_S CTF_FS_METADATA_FILENAME);
        fp = fopen(metadata_path->str, "rb");
        g_string_free(metadata_path, TRUE);
 end:
@@ -67,7 +67,7 @@ static struct ctf_fs_file *get_file(const char *trace_path)
        }
 
        g_string_append(file->path, trace_path);
-       g_string_append(file->path, "/" CTF_FS_METADATA_FILENAME);
+       g_string_append(file->path, G_DIR_SEPARATOR_S CTF_FS_METADATA_FILENAME);
 
        if (ctf_fs_file_open(file, "rb")) {
                goto error;
This page took 0.029426 seconds and 4 git commands to generate.