diff --git a/system/adb/shell_pipe.c b/system/adb/shell_pipe.c index 762476bab..a3dc6b1a1 100644 --- a/system/adb/shell_pipe.c +++ b/system/adb/shell_pipe.c @@ -1,5 +1,5 @@ /**************************************************************************** - * system/adb/shell_pipe.c + * apps/system/adb/shell_pipe.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -187,7 +187,7 @@ int shell_pipe_exec(char * const argv[], shell_pipe_t *apipe, /* Setup stdout (read: adb, write: child) */ ret = dup2(out_fds[1], 1); - assert(ret == 0); + assert(ret == 1); ret = close(out_fds[1]); assert(ret == 0); @@ -229,8 +229,9 @@ int shell_pipe_exec(char * const argv[], shell_pipe_t *apipe, /* Create shell process */ ret = task_create("ADB shell", CONFIG_SYSTEM_NSH_PRIORITY, - CONFIG_SYSTEM_NSH_STACKSIZE, nsh_consolemain, - &argv[1]); + CONFIG_SYSTEM_NSH_STACKSIZE, + argv ? nsh_system : nsh_consolemain, + argv); /* Close stdin and stdout */