Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
scorpio
system_vold
Commits
08da5c1f
Commit
08da5c1f
authored
14 years ago
by
Jean-Baptiste Queru
Committed by
Android Code Review
14 years ago
Browse files
Options
Download
Plain Diff
Merge "vold: replace strsep by strtok_r"
parents
09f774b7
74ca25a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
main.cpp
main.cpp
+8
-7
No files found.
main.cpp
View file @
08da5c1f
...
...
@@ -177,7 +177,8 @@ static int process_config(VolumeManager *vm) {
}
while
(
fgets
(
line
,
sizeof
(
line
),
fp
))
{
char
*
next
=
line
;
const
char
*
delim
=
"
\t
"
;
char
*
save_ptr
;
char
*
type
,
*
label
,
*
mount_point
;
n
++
;
...
...
@@ -186,24 +187,24 @@ static int process_config(VolumeManager *vm) {
if
(
line
[
0
]
==
'#'
||
line
[
0
]
==
'\0'
)
continue
;
if
(
!
(
type
=
str
sep
(
&
next
,
"
\t
"
)))
{
if
(
!
(
type
=
str
tok_r
(
line
,
delim
,
&
save_ptr
)))
{
SLOGE
(
"Error parsing type"
);
goto
out_syntax
;
}
if
(
!
(
label
=
str
sep
(
&
next
,
"
\t
"
)))
{
if
(
!
(
label
=
str
tok_r
(
NULL
,
delim
,
&
save_ptr
)))
{
SLOGE
(
"Error parsing label"
);
goto
out_syntax
;
}
if
(
!
(
mount_point
=
str
sep
(
&
next
,
"
\t
"
)))
{
if
(
!
(
mount_point
=
str
tok_r
(
NULL
,
delim
,
&
save_ptr
)))
{
SLOGE
(
"Error parsing mount point"
);
goto
out_syntax
;
}
if
(
!
strcmp
(
type
,
"dev_mount"
))
{
DirectVolume
*
dv
=
NULL
;
char
*
part
,
*
sysfs_path
;
char
*
part
;
if
(
!
(
part
=
str
sep
(
&
next
,
"
\t
"
)))
{
if
(
!
(
part
=
str
tok_r
(
NULL
,
delim
,
&
save_ptr
)))
{
SLOGE
(
"Error parsing partition"
);
goto
out_syntax
;
}
...
...
@@ -218,7 +219,7 @@ static int process_config(VolumeManager *vm) {
dv
=
new
DirectVolume
(
vm
,
label
,
mount_point
,
atoi
(
part
));
}
while
((
sysfs_path
=
str
sep
(
&
next
,
"
\t
"
)
))
{
while
(
char
*
sysfs_path
=
str
tok_r
(
NULL
,
delim
,
&
save_ptr
))
{
if
(
dv
->
addPath
(
sysfs_path
))
{
SLOGE
(
"Failed to add devpath %s to volume %s"
,
sysfs_path
,
label
);
...
...
This diff is collapsed.
Click to expand it.
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