From 0fdb8bb0256c3dc90d3398fd70112a9081e91e58 Mon Sep 17 00:00:00 2001 From: compudj Date: Mon, 21 Jun 2004 17:16:53 +0000 Subject: [PATCH] traces now identified by device:inode in attributes git-svn-id: http://ltt.polymtl.ca/svn@602 04897980-b3bd-0310-b5e0-8ef037075253 --- .../gui/lttvwindow/lttvwindow/gtkdirsel.c | 5 +++-- .../lttvwindow/lttvwindow/lttvwindowtraces.c | 19 ++++++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/gtkdirsel.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/gtkdirsel.c index a52e877d..6a932ed0 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/gtkdirsel.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/gtkdirsel.c @@ -21,6 +21,7 @@ #include #include #include +#include // For PATH_MAX #ifdef HAVE_SYS_PARAM_H #include #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); diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c index 3a190006..bafc5fdd 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c @@ -20,6 +20,10 @@ /* Here is the implementation of the API */ +#include +#include +#include + #include #include #include @@ -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; -- 2.34.1