Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 67afaad5 authored by Mike Lockwood's avatar Mike Lockwood Committed by Android Git Automerger
Browse files

am d4894f4b: am 034117e4: Merge changes...

am d4894f4b: am 034117e4: Merge changes I8df51128,Ie922b3e7,I31f78419,I7e8df44d,I6067857b,Ifd35587c,Ie8d66740

* commit 'd4894f4b':
  Fix adb leaking file descriptors to forked processes
  adb: Fix command-line parser.
  adb: Increase device descriptor buffer size in Linux host USB support
  adb: improve debug traces readability.
  adb: Don't report negative number of bytes after pushing file > 2 gigabytes
  Adding Texas Instruments to the VID list.
  Support an additional alias for 'adb shell.'
parents e442cff0 d4894f4b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -682,9 +682,11 @@ void start_device_log(void)
    dup2(fd, 1);
    dup2(fd, 2);
    fprintf(stderr,"--- adb starting (pid %d) ---\n", getpid());
    adb_close(fd);

    fd = unix_open("/dev/null", O_RDONLY);
    dup2(fd, 0);
    adb_close(fd);
}
#endif

@@ -1266,8 +1268,8 @@ int recovery_mode = 0;

int main(int argc, char **argv)
{
    adb_trace_init();
#if ADB_HOST
    adb_trace_init();
    adb_sysdeps_init();
    return adb_commandline(argc - 1, argv + 1);
#else
+5 −2
Original line number Diff line number Diff line
@@ -683,6 +683,7 @@ int adb_commandline(int argc, char **argv)
    char buf[4096];
    int no_daemon = 0;
    int is_daemon = 0;
    int is_server = 0;
    int persist = 0;
    int r;
    int quote;
@@ -719,7 +720,9 @@ int adb_commandline(int argc, char **argv)

    /* modifiers and flags */
    while(argc > 0) {
        if(!strcmp(argv[0],"nodaemon")) {
        if(!strcmp(argv[0],"server")) {
            is_server = 1;
        } else if(!strcmp(argv[0],"nodaemon")) {
            no_daemon = 1;
        } else if (!strcmp(argv[0], "fork-server")) {
            /* this is a special flag used only when the ADB client launches the ADB Server */
@@ -766,7 +769,7 @@ int adb_commandline(int argc, char **argv)
    adb_set_transport(ttype, serial);
    adb_set_tcp_specifics(server_port);

    if ((argc > 0) && (!strcmp(argv[0],"server"))) {
    if (is_server) {
        if (no_daemon || is_daemon) {
            r = adb_main(is_daemon, server_port);
        } else {
+1 −0
Original line number Diff line number Diff line
@@ -499,6 +499,7 @@ jdwp_control_init( JdwpControl* control,

    /* only wait for incoming connections */
    fdevent_add(control->fde, FDE_READ);
    close_on_exec(s);

    D("jdwp control socket started (%d)\n", control->listen_socket);
    return 0;
+1 −0
Original line number Diff line number Diff line
@@ -309,6 +309,7 @@ static int create_subprocess(const char *cmd, const char *arg0, const char *arg1
        dup2(pts, 1);
        dup2(pts, 2);

        adb_close(pts);
        adb_close(ptm);

        execl(cmd, cmd, arg0, arg1, NULL);
+7 −1
Original line number Diff line number Diff line
@@ -387,7 +387,13 @@ static __inline__ int adb_creat(const char* path, int mode)

static __inline__ int  adb_socket_accept(int  serverfd, struct sockaddr*  addr, socklen_t  *addrlen)
{
    return  accept( serverfd, addr, addrlen );
    int fd;

    fd = accept(serverfd, addr, addrlen);
    if (fd >= 0)
        close_on_exec(fd);

    return fd;
}

#undef   accept
Loading