Fix: handling of the filename
[lttngtop.git] / src / iostreamtop.c
index f3fef7b25ea97043dfc8f89949fb3bbf05556811..e0df4ba2292e6f6f3c1b0dceddc16ba496c4f3ef 100644 (file)
@@ -103,7 +103,7 @@ void insert_file(struct processtop *proc, int fd)
                return;
        if (fd >= proc->process_files_table->len) {
                tmp = g_new0(struct files, 1);
-               tmp->name = "Unknown";
+               tmp->name = NULL;
                tmp->read = 0;
                tmp->write = 0;
                tmp->fd = fd;
@@ -113,7 +113,7 @@ void insert_file(struct processtop *proc, int fd)
                tmp = g_ptr_array_index(proc->process_files_table, fd);
                if (tmp == NULL) {
                        tmp = g_new0(struct files, 1);
-                       tmp->name = "Unknown";
+                       tmp->name = NULL;
                        tmp->read = 0;
                        tmp->write = 0;
                        tmp->fd = fd;
@@ -124,7 +124,7 @@ void insert_file(struct processtop *proc, int fd)
                        if (parent) {
                                tmp_parent = g_ptr_array_index(
                                        parent->process_files_table, fd);
-                               if (tmp_parent &&
+                               if (tmp_parent && tmp->name &&
                                   (strcmp(tmp->name, tmp_parent->name)) != 0)
                                        tmp->name = strdup(tmp_parent->name);
                        }
This page took 0.022878 seconds and 4 git commands to generate.