traces now identified by device:inode in attributes
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 21 Jun 2004 17:16:53 +0000 (17:16 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 21 Jun 2004 17:16:53 +0000 (17:16 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@602 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/gtkdirsel.c
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c

index a52e877db1c5fee86df556ad5f7b9f5e96a2a8a7..6a932ed098cdd29bd407682e00103756faa21fd2 100644 (file)
@@ -21,6 +21,7 @@
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <limits.h> // For PATH_MAX
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
 #endif
@@ -416,7 +417,7 @@ translate_win32_path (GtkDirSelection *filesel)
 {
   int updated = 0;
   const gchar *path;
-  gchar newPath[MAX_PATH];
+  gchar newPath[PATH_MAX];
 
   /*
    * Retrieve the current path
@@ -1916,7 +1917,7 @@ get_real_filename (gchar    *filename,
   /* Check to see if the selection was a drive selector */
   if (isalpha (filename[0]) && (filename[1] == ':'))
     {
-      gchar temp_filename[MAX_PATH];
+      gchar temp_filename[PATH_MAX];
       int len;
 
       cygwin_conv_to_posix_path (filename, temp_filename);
index 3a190006e69d04062792735723a6887049666f5b..bafc5fdd06fd6925193bd5cebfc4982eb087baa3 100644 (file)
 
 /* Here is the implementation of the API */
 
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
 #include <ltt/time.h>
 #include <ltt/trace.h>
 #include <glib.h>
@@ -126,14 +130,23 @@ void lttvwindowtraces_add_trace(LttvTrace *trace)
   LttvAttribute *attribute;
   LttvAttributeValue value;
   guint num;
+  struct stat buf;
+  gchar attribute_path[PATH_MAX];
 
+  if(stat(ltt_trace_name(lttv_trace(trace)), &buf)) {
+    g_warning("lttvwindowtraces_add_trace: Trace %s not found",
+        ltt_trace_name(lttv_trace(trace)));
+    return;
+  }
+  g_assert(
+      snprintf(attribute_path, PATH_MAX, "%lu:%lu", buf.st_dev, buf.st_ino) >= 0);
+  
   g_assert(attribute = 
       LTTV_ATTRIBUTE(lttv_iattribute_find_subdir(LTTV_IATTRIBUTE(g_attribute),
                                 LTTV_TRACES)));
-  num = lttv_attribute_get_number(attribute);
+    
   value = lttv_attribute_add(attribute,
-                     num,
+                     g_quark_from_string(attribute_path),
                      LTTV_POINTER);
 
   *(value.v_pointer) = (gpointer)trace;
This page took 0.026331 seconds and 4 git commands to generate.