summaryrefslogtreecommitdiffstats
path: root/minadbd
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2017-09-08 13:50:54 +0200
committerEthan Yonker <dees_troy@teamw.in>2017-09-08 14:14:59 +0200
commit8373cfe28cf1b5ad758faa1d502e21787c3665e4 (patch)
tree2f567c52cd6f89e1052481497d236b58d230b7e2 /minadbd
parentDO NOT MERGE Android 8.0 stuff (diff)
parentrelease-request-f4ecf242-5d1c-45e0-8c7c-ede48d1a9e82-for-git_oc-release-4111650 snap-temp-L02200000075283731 (diff)
downloadandroid_bootable_recovery-8373cfe28cf1b5ad758faa1d502e21787c3665e4.tar
android_bootable_recovery-8373cfe28cf1b5ad758faa1d502e21787c3665e4.tar.gz
android_bootable_recovery-8373cfe28cf1b5ad758faa1d502e21787c3665e4.tar.bz2
android_bootable_recovery-8373cfe28cf1b5ad758faa1d502e21787c3665e4.tar.lz
android_bootable_recovery-8373cfe28cf1b5ad758faa1d502e21787c3665e4.tar.xz
android_bootable_recovery-8373cfe28cf1b5ad758faa1d502e21787c3665e4.tar.zst
android_bootable_recovery-8373cfe28cf1b5ad758faa1d502e21787c3665e4.zip
Diffstat (limited to 'minadbd')
-rw-r--r--minadbd/Android.mk6
-rw-r--r--minadbd/README.md (renamed from minadbd/README.txt)2
-rw-r--r--minadbd/fuse_adb_provider.cpp2
-rw-r--r--minadbd/minadbd.cpp (renamed from minadbd/adb_main.cpp)6
-rw-r--r--minadbd/minadbd.h22
-rw-r--r--minadbd/minadbd_services.cpp (renamed from minadbd/services.cpp)7
6 files changed, 32 insertions, 13 deletions
diff --git a/minadbd/Android.mk b/minadbd/Android.mk
index 24d16350f..fb90f6120 100644
--- a/minadbd/Android.mk
+++ b/minadbd/Android.mk
@@ -12,10 +12,10 @@ minadbd_cflags := \
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
- adb_main.cpp \
fuse_adb_provider.cpp \
- services.cpp \
- ../fuse_sideload.cpp
+ ../fuse_sideload.cpp \
+ minadbd.cpp \
+ minadbd_services.cpp \
LOCAL_CLANG := true
LOCAL_MODULE := libminadbd
diff --git a/minadbd/README.txt b/minadbd/README.md
index e69dc87c6..5a0a067de 100644
--- a/minadbd/README.txt
+++ b/minadbd/README.md
@@ -3,6 +3,6 @@ minadbd, and services.c has been modified as follows:
- all services removed
- all host mode support removed
- - sideload_service() added; this is the only service supported. It
+ - `sideload_service()` added; this is the only service supported. It
receives a single blob of data, writes it to a fixed filename, and
makes the process exit.
diff --git a/minadbd/fuse_adb_provider.cpp b/minadbd/fuse_adb_provider.cpp
index d71807dfb..0f4c2563d 100644
--- a/minadbd/fuse_adb_provider.cpp
+++ b/minadbd/fuse_adb_provider.cpp
@@ -19,8 +19,6 @@
#include <string.h>
#include <errno.h>
-#include "sysdeps.h"
-
#include "adb.h"
#include "adb_io.h"
#include "fuse_adb_provider.h"
diff --git a/minadbd/adb_main.cpp b/minadbd/minadbd.cpp
index 1db0d5f58..d9da1974f 100644
--- a/minadbd/adb_main.cpp
+++ b/minadbd/minadbd.cpp
@@ -14,18 +14,18 @@
* limitations under the License.
*/
+#include "minadbd.h"
+
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
-#include "sysdeps.h"
-
#include "adb.h"
#include "adb_auth.h"
#include "transport.h"
-int adb_server_main(int is_daemon, int server_port, int /* reply_fd */) {
+int minadbd_main() {
adb_device_banner = "sideload";
signal(SIGPIPE, SIG_IGN);
diff --git a/minadbd/minadbd.h b/minadbd/minadbd.h
new file mode 100644
index 000000000..3570a5da5
--- /dev/null
+++ b/minadbd/minadbd.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef MINADBD_H__
+#define MINADBD_H__
+
+int minadbd_main();
+
+#endif
diff --git a/minadbd/services.cpp b/minadbd/minadbd_services.cpp
index 753a14e38..e558f9702 100644
--- a/minadbd/services.cpp
+++ b/minadbd/minadbd_services.cpp
@@ -21,11 +21,10 @@
#include <string.h>
#include <unistd.h>
-#include "sysdeps.h"
-
#include "adb.h"
#include "fdevent.h"
#include "fuse_adb_provider.h"
+#include "sysdeps.h"
typedef struct stinfo stinfo;
@@ -62,12 +61,12 @@ static void sideload_host_service(int sfd, void* data) {
static int create_service_thread(void (*func)(int, void *), void *cookie) {
int s[2];
- if(adb_socketpair(s)) {
+ if (adb_socketpair(s)) {
printf("cannot create service socket pair\n");
return -1;
}
- stinfo* sti = reinterpret_cast<stinfo*>(malloc(sizeof(stinfo)));
+ stinfo* sti = static_cast<stinfo*>(malloc(sizeof(stinfo)));
if(sti == 0) fatal("cannot allocate stinfo");
sti->func = func;
sti->cookie = cookie;