summaryrefslogtreecommitdiffstats
path: root/adb/console.c
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-03 18:29:04 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-03 18:29:04 -0800
commite54eebbf1a908d65ee8cf80bab62821c05666d70 (patch)
tree4b825dc642cb6eb9a060e54bf8d69288fbee4904 /adb/console.c
parenta1e1c1b106423de09bc918502e7a51d4ffe5a4ae (diff)
downloadcore-e54eebbf1a908d65ee8cf80bab62821c05666d70.tar.gz
core-e54eebbf1a908d65ee8cf80bab62821c05666d70.tar.bz2
core-e54eebbf1a908d65ee8cf80bab62821c05666d70.zip
auto import from //depot/cupcake/@135843
Diffstat (limited to 'adb/console.c')
-rw-r--r--adb/console.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/adb/console.c b/adb/console.c
deleted file mode 100644
index b813d337d..000000000
--- a/adb/console.c
+++ /dev/null
@@ -1,45 +0,0 @@
-#include "sysdeps.h"
-#include "adb.h"
-#include "adb_client.h"
-#include <stdio.h>
-
-static int connect_to_console(void)
-{
- int fd, port;
-
- port = adb_get_emulator_console_port();
- if (port < 0) {
- if (port == -2)
- fprintf(stderr, "error: more than one emulator detected. use -s option\n");
- else
- fprintf(stderr, "error: no emulator detected\n");
- return -1;
- }
- fd = socket_loopback_client( port, SOCK_STREAM );
- if (fd < 0) {
- fprintf(stderr, "error: could not connect to TCP port %d\n", port);
- return -1;
- }
- return fd;
-}
-
-
-int adb_send_emulator_command(int argc, char** argv)
-{
- int fd, nn;
-
- fd = connect_to_console();
- if (fd < 0)
- return 1;
-
-#define QUIT "quit\n"
-
- for (nn = 1; nn < argc; nn++) {
- adb_write( fd, argv[nn], strlen(argv[nn]) );
- adb_write( fd, (nn == argc-1) ? "\n" : " ", 1 );
- }
- adb_write( fd, QUIT, sizeof(QUIT)-1 );
- adb_close(fd);
-
- return 0;
-}