Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Dec 2013 13:51:14 +0000 (UTC)
From:      Peter Holm <pho@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r259867 - user/pho/stress2/misc
Message-ID:  <201312251351.rBPDpEI2045977@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pho
Date: Wed Dec 25 13:51:14 2013
New Revision: 259867
URL: http://svnweb.freebsd.org/changeset/base/259867

Log:
  Handle leading space in pid and add more cleanup.
  
  Sponsored by:	EMC / Isilon storage division

Modified:
  user/pho/stress2/misc/signal.sh

Modified: user/pho/stress2/misc/signal.sh
==============================================================================
--- user/pho/stress2/misc/signal.sh	Wed Dec 25 12:41:53 2013	(r259866)
+++ user/pho/stress2/misc/signal.sh	Wed Dec 25 13:51:14 2013	(r259867)
@@ -192,7 +192,7 @@ cc -o waitthread -Wall -Wextra waitthrea
 cc -o tkill -Wall -Wextra tkill.c || exit
 rm -f waitthread.c tkill.c
 
-rm -f gdbfifo gdbout pstat
+rm -f gdbfifo gdbout pstat /tmp/waitthread
 mkfifo gdbfifo
 sleep 300 > gdbfifo &	# Keep the fifo open
 fifopid=$!
@@ -202,7 +202,7 @@ echo "set args 8" > gdbfifo
 echo "run"        > gdbfifo
 sleep .2
 
-pid=`ps | grep -v grep | grep "waitthread 8" | sed 's/ .*//'`
+pid=`ps | grep -v grep | grep "waitthread 8" | sed 's/^ *//;s/ .*//'`
 procstat -t $pid > pstat
 
 t1=`grep fifo  pstat | awk '{print $2}'`
@@ -217,7 +217,7 @@ echo "quit" > gdbfifo
 kill $fifopid
 
 if grep -q "signal SIGINT" gdbout; then
-	rm -f gdbfifo gdbout pstat waitthread tkill
+	rm -f gdbfifo gdbout pstat waitthread tkill /tmp/waitthread
 else
 	echo FAIL
 fi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312251351.rBPDpEI2045977>