summaryrefslogtreecommitdiffstats
path: root/minadbd/adb_main.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--minadbd/adb_main.c (renamed from minadbd/transport.h)39
1 files changed, 29 insertions, 10 deletions
diff --git a/minadbd/transport.h b/minadbd/adb_main.c
index 992e05285..f6e240108 100644
--- a/minadbd/transport.h
+++ b/minadbd/adb_main.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 The Android Open Source Project
+ * Copyright (C) 2015 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.
@@ -14,13 +14,32 @@
* limitations under the License.
*/
-#ifndef __TRANSPORT_H
-#define __TRANSPORT_H
+#include <errno.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
-/* convenience wrappers around read/write that will retry on
-** EINTR and/or short read/write. Returns 0 on success, -1
-** on error or EOF.
-*/
-int readx(int fd, void *ptr, size_t len);
-int writex(int fd, const void *ptr, size_t len);
-#endif /* __TRANSPORT_H */
+#define TRACE_TAG TRACE_ADB
+
+#include "sysdeps.h"
+
+#include "adb.h"
+#include "transport.h"
+
+int adb_main(int is_daemon, int server_port)
+{
+ atexit(usb_cleanup);
+
+ adb_device_banner = "sideload";
+
+ // No SIGCHLD. Let the service subproc handle its children.
+ signal(SIGPIPE, SIG_IGN);
+
+ init_transport_registration();
+ usb_init();
+
+ D("Event loop starting\n");
+ fdevent_loop();
+
+ return 0;
+}