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
halo
bootable_recovery
Commits
8c389e9c
Commit
8c389e9c
authored
10 years ago
by
Elliott Hughes
Committed by
Gerrit Code Review
10 years ago
Browse files
Options
Download
Plain Diff
Merge "Stop using adb_strtok, and check argument validity."
parents
6725ebc7
ba45ddf3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
minadbd/services.cpp
minadbd/services.cpp
+10
-9
No files found.
minadbd/services.cpp
View file @
8c389e9c
...
...
@@ -43,15 +43,16 @@ void* service_bootstrap_func(void* x) {
return
0
;
}
static
void
sideload_host_service
(
int
sfd
,
void
*
cookie
)
{
char
*
saveptr
;
const
char
*
s
=
adb_strtok_r
(
reinterpret_cast
<
char
*>
(
cookie
),
":"
,
&
saveptr
);
uint64_t
file_size
=
strtoull
(
s
,
NULL
,
10
);
s
=
adb_strtok_r
(
NULL
,
":"
,
&
saveptr
);
uint32_t
block_size
=
strtoul
(
s
,
NULL
,
10
);
printf
(
"sideload-host file size %"
PRIu64
" block size %"
PRIu32
"
\n
"
,
file_size
,
block_size
);
static
void
sideload_host_service
(
int
sfd
,
void
*
data
)
{
const
char
*
args
=
reinterpret_cast
<
const
char
*>
(
data
);
int
file_size
;
int
block_size
;
if
(
sscanf
(
args
,
"%d:%d"
,
&
file_size
,
&
block_size
)
!=
2
)
{
printf
(
"bad sideload-host arguments: %s
\n
"
,
args
);
exit
(
1
);
}
printf
(
"sideload-host file size %d block size %d
\n
"
,
file_size
,
block_size
);
int
result
=
run_adb_fuse
(
sfd
,
file_size
,
block_size
);
...
...
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