[gnome-builder] tools: allow passing full path to counters



commit c3e41e9acae366dbe1b002a9c102f9e9eefc5dee
Author: Christian Hergert <chergert redhat com>
Date:   Fri May 13 14:47:18 2016 +0300

    tools: allow passing full path to counters
    
    This can be handy to just pass the path to the counters.

 tools/ide-list-counters.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/tools/ide-list-counters.c b/tools/ide-list-counters.c
index b104661..42dbcbd 100644
--- a/tools/ide-list-counters.c
+++ b/tools/ide-list-counters.c
@@ -19,6 +19,7 @@
 #include "egg-counter.h"
 
 #include <errno.h>
+#include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -75,6 +76,9 @@ main (gint   argc,
       return EXIT_FAILURE;
     }
 
+  if (g_str_has_prefix (argv [1], "/dev/shm/EggCounters-"))
+    argv [1] += strlen ("/dev/shm/EggCounters-");
+
   if (!int_parse_with_range (&pid, 1, G_MAXUSHORT, argv [1]))
     {
       fprintf (stderr, "usage: %s <pid>\n", argv [0]);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]