Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Zbigniew Jędrzejewski-Szmek
polkit
Commits
c372969e
Commit
c372969e
authored
Nov 11, 2007
by
David Zeuthen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use kit_strsplit in polkit-sysdeps
parent
09a434c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
src/kit/kit-string.c
src/kit/kit-string.c
+0
-1
src/polkit/polkit-sysdeps.c
src/polkit/polkit-sysdeps.c
+7
-5
No files found.
src/kit/kit-string.c
View file @
c372969e
...
...
@@ -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
;
...
...
src/polkit/polkit-sysdeps.c
View file @
c372969e
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment