summaryrefslogtreecommitdiffstats
path: root/minadbd/services.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-04-28 20:03:22 +0200
committerAndroid Git Automerger <android-git-automerger@android.com>2015-04-28 20:03:22 +0200
commitbc4e69fc2827d7b8648a30d3b29eca3cb886fc9a (patch)
treecf3e1d4b9957032db8046f4bb49d5878cb60a538 /minadbd/services.cpp
parentam 6725ebc7: Merge "Revert "Revert "init re-execs to set its security context now.""" (diff)
parentMerge "Stop using adb_strtok, and check argument validity." (diff)
downloadandroid_bootable_recovery-bc4e69fc2827d7b8648a30d3b29eca3cb886fc9a.tar
android_bootable_recovery-bc4e69fc2827d7b8648a30d3b29eca3cb886fc9a.tar.gz
android_bootable_recovery-bc4e69fc2827d7b8648a30d3b29eca3cb886fc9a.tar.bz2
android_bootable_recovery-bc4e69fc2827d7b8648a30d3b29eca3cb886fc9a.tar.lz
android_bootable_recovery-bc4e69fc2827d7b8648a30d3b29eca3cb886fc9a.tar.xz
android_bootable_recovery-bc4e69fc2827d7b8648a30d3b29eca3cb886fc9a.tar.zst
android_bootable_recovery-bc4e69fc2827d7b8648a30d3b29eca3cb886fc9a.zip
Diffstat (limited to 'minadbd/services.cpp')
-rw-r--r--minadbd/services.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/minadbd/services.cpp b/minadbd/services.cpp
index a83256796..dd1fd7c4b 100644
--- a/minadbd/services.cpp
+++ b/minadbd/services.cpp
@@ -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);