#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
{
int updated = 0;
const gchar *path;
- gchar newPath[MAX_PATH];
+ gchar newPath[PATH_MAX];
/*
* Retrieve the current path
/* 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);
/* 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>
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;