PolicyKit: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Sat Nov 10 21:09:09 PST 2007


 src/kit/kit-string.c        |    1 -
 src/polkit/polkit-sysdeps.c |   12 +++++++-----
 2 files changed, 7 insertions(+), 6 deletions(-)

New commits:
commit c372969e98140faa2df6e3c2509797b0e8670eb9
Author: David Zeuthen <davidz at redhat.com>
Date:   Sun Nov 11 00:05:41 2007 -0500

    use kit_strsplit in polkit-sysdeps

diff --git a/src/kit/kit-string.c b/src/kit/kit-string.c
index 91f93a9..acd0973 100644
--- a/src/kit/kit-string.c
+++ b/src/kit/kit-string.c
@@ -273,7 +273,6 @@ kit_strsplit (const char *s, char delim, size_t *num_tokens)
                         m++;
 
                 result[n] = kit_strndup (s + begin, m - begin);
-                kit_debug ("'%s'", result[n]);
                 if (result[n] == NULL)
                         goto oom;
 
diff --git a/src/polkit/polkit-sysdeps.c b/src/polkit/polkit-sysdeps.c
index cebbc92..174f85d 100644
--- a/src/polkit/polkit-sysdeps.c
+++ b/src/polkit/polkit-sysdeps.c
@@ -38,8 +38,6 @@
 #include <sys/inotify.h>
 #include <syslog.h>
 
-#include <glib.h>
-
 #include "polkit-sysdeps.h"
 #include "polkit-private.h"
 
@@ -73,6 +71,7 @@ polkit_sysdeps_get_start_time_for_pid (pid_t pid)
         size_t length;
         polkit_uint64_t start_time;
         char **tokens;
+        size_t num_tokens;
         char *p;
         char *endp;
 
@@ -101,8 +100,11 @@ polkit_sysdeps_get_start_time_for_pid (pid_t pid)
                 goto out;
         }
 
-        tokens = g_strsplit (p, " ", 0);
-        if (g_strv_length (tokens) < 20) {
+        tokens = kit_strsplit (p, ' ', &num_tokens);
+        if (tokens == NULL)
+                goto out;
+
+        if (num_tokens < 20) {
                 goto out;
         }
 
@@ -111,7 +113,7 @@ polkit_sysdeps_get_start_time_for_pid (pid_t pid)
                 goto out;
         }
 
-        g_strfreev (tokens);
+        kit_strfreev (tokens);
 
 out:
         kit_free (filename);


More information about the hal-commit mailing list