diff options
Diffstat (limited to 'minadbd')
-rw-r--r-- | minadbd/Android.mk | 6 | ||||
-rw-r--r-- | minadbd/README.md (renamed from minadbd/README.txt) | 2 | ||||
-rw-r--r-- | minadbd/fuse_adb_provider.cpp | 2 | ||||
-rw-r--r-- | minadbd/minadbd.cpp (renamed from minadbd/adb_main.cpp) | 6 | ||||
-rw-r--r-- | minadbd/minadbd.h | 22 | ||||
-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; |