Also make the cleanup kill more focused.
---
 tests/pgrep.test | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
From 2fb8c150fb2053d817dad000523a08026c803669 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <e...@google.com>
Date: Sun, 2 Apr 2017 12:29:39 -0700
Subject: [PATCH] Make pgrep tests runnable on toybox-only systems.

Also make the cleanup kill more focused.
---
 tests/pgrep.test | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/pgrep.test b/tests/pgrep.test
index 3319c79..8db848f 100755
--- a/tests/pgrep.test
+++ b/tests/pgrep.test
@@ -16,7 +16,7 @@ proc=$!
 #echo "# Process created with id: $proc"
 sleep .1
 session_id=0
-proc_parent=`cat /proc/${proc}/stat | awk '{ print $4 }'`
+proc_parent=`cat /proc/${proc}/stat | cut -d' ' -f4`
 #echo "# Parent Process id of $proc is $proc_parent"
 
 # Testcases for pgrep command
@@ -34,4 +34,4 @@ testing "return failure" "pgrep almost-certainly-not || echo failure" \
     "failure\n" "" ""
 
 #Clean-up
-killall yes >/dev/null 2>&1
+kill -9 $proc
-- 
2.12.2.564.g063fe858b8-goog

_______________________________________________
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to