Merge "Fix \'ps --ppid\'." am: 47f808d
am: 29ea565
* commit '29ea5654e3a13a0cedd759c97df22dd70027cb8c':
Fix 'ps --ppid'.
Change-Id: I9484c46010fd4b04de53b44903bb8e0e2a6647a6
diff --git a/toolbox/ps.c b/toolbox/ps.c
index d366f3e..633c48e 100644
--- a/toolbox/ps.c
+++ b/toolbox/ps.c
@@ -282,6 +282,13 @@
} else if(!strcmp(argv[1],"--abi")) {
display_flags |= SHOW_ABI;
} else if(!strcmp(argv[1],"--ppid")) {
+ if (argc < 3) {
+ /* Bug 26554285: Use printf because some apps require at least
+ * one line of output to stdout even for errors.
+ */
+ printf("no ppid\n");
+ return 1;
+ }
ppid_filter = atoi(argv[2]);
if (ppid_filter == 0) {
/* Bug 26554285: Use printf because some apps require at least