[csw-devel] SF.net SVN: gar:[21446] csw/mgar/pkg/tracker/trunk
slowfranklin at users.sourceforge.net
slowfranklin at users.sourceforge.net
Fri Jul 5 13:59:31 CEST 2013
Revision: 21446
http://gar.svn.sourceforge.net/gar/?rev=21446&view=rev
Author: slowfranklin
Date: 2013-07-05 11:59:26 +0000 (Fri, 05 Jul 2013)
Log Message:
-----------
tracker/trunk: Patch for using psinfo procfs instead of cmdline
Modified Paths:
--------------
csw/mgar/pkg/tracker/trunk/Makefile
Added Paths:
-----------
csw/mgar/pkg/tracker/trunk/files/0006-Use-procfs-psinfo-instead-of-cmdline-on-Solaris.patch
Modified: csw/mgar/pkg/tracker/trunk/Makefile
===================================================================
--- csw/mgar/pkg/tracker/trunk/Makefile 2013-07-05 11:28:21 UTC (rev 21445)
+++ csw/mgar/pkg/tracker/trunk/Makefile 2013-07-05 11:59:26 UTC (rev 21446)
@@ -113,6 +113,8 @@
PATCHFILES += 0003-Replace-uuid_unparse_lower-with-uuid_unparse.patch
PATCHFILES += 0004-_XOPEN_SOURCE-hides-non-standard-stuff-__EXTENSIONS_.patch
PATCHFILES += 0005-exempi-xmp.h-is-missing-a-stdbool.h-include.patch
+# submitted upstream
+PATCHFILES += 0006-Use-procfs-psinfo-instead-of-cmdline-on-Solaris.patch
# Packages
PACKAGES += CSWtracker
Added: csw/mgar/pkg/tracker/trunk/files/0006-Use-procfs-psinfo-instead-of-cmdline-on-Solaris.patch
===================================================================
--- csw/mgar/pkg/tracker/trunk/files/0006-Use-procfs-psinfo-instead-of-cmdline-on-Solaris.patch (rev 0)
+++ csw/mgar/pkg/tracker/trunk/files/0006-Use-procfs-psinfo-instead-of-cmdline-on-Solaris.patch 2013-07-05 11:59:26 UTC (rev 21446)
@@ -0,0 +1,69 @@
+From d32ac25093d37871c2ce3889314d5db9bb34d1ad Mon Sep 17 00:00:00 2001
+From: Ralph Boehme <sloowfranklin at gmail.com>
+Date: Fri, 5 Jul 2013 13:15:15 +0200
+Subject: [PATCH] Use procfs psinfo instead of cmdline on Solaris
+
+---
+ src/tracker-control/tracker-control-general.c | 21 ++++++++++++++++++---
+ 1 file changed, 18 insertions(+), 3 deletions(-)
+
+diff --git a/src/tracker-control/tracker-control-general.c b/src/tracker-control/tracker-control-general.c
+index 07231ef..b00c60d 100644
+--- a/src/tracker-control/tracker-control-general.c
++++ b/src/tracker-control/tracker-control-general.c
+@@ -24,6 +24,10 @@
+ #include <glib.h>
+ #include <glib/gi18n.h>
+
++#ifdef __sun
++#include <procfs.h>
++#endif
++
+ #include <libtracker-common/tracker-common.h>
+ #include <libtracker-data/tracker-data.h>
+ #include <libtracker-miner/tracker-miner.h>
+@@ -528,7 +532,11 @@ get_uid_for_pid (const gchar *pid_as_string,
+ gchar *fn;
+ guint uid;
+
++#ifdef __sun /* Solaris */
++ fn = g_build_filename ("/proc", pid_as_string, "psinfo", NULL);
++#else
+ fn = g_build_filename ("/proc", pid_as_string, "cmdline", NULL);
++#endif
+
+ f = g_file_new_for_path (fn);
+ info = g_file_query_info (f,
+@@ -667,7 +675,12 @@ tracker_control_general_run (void)
+ for (l = pids; l; l = l->next) {
+ GError *error = NULL;
+ gchar *filename;
++ gchar *basename;
++#ifdef __sun /* Solaris */
++ psinfo_t psinfo = { 0 };
++#endif
+ gchar *contents = NULL;
++
+ gchar **strv;
+ guint uid;
+
+@@ -691,11 +704,13 @@ tracker_control_general_run (void)
+
+ continue;
+ }
+-
++#ifdef __sun /* Solaris */
++ memcpy(&psinfo, contents, sizeof(psinfo));
++ strv = g_strsplit (psinfo.pr_psargs, " ", 2); /* won't work with paths containing spaces :( */
++#else
+ strv = g_strsplit (contents, "^@", 2);
++#endif
+ if (strv && strv[0]) {
+- gchar *basename;
+-
+ basename = g_path_get_basename (strv[0]);
+
+ if ((g_str_has_prefix (basename, "tracker") == TRUE ||
+--
+1.8.3.1
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list