[sapwood] only try to terminate the daemon when it's running



commit 79825ca9f1504e2851eadd9010b9b7c6affec4c3
Author: Sven Herzberg <herzi gnome-de org>
Date:   Thu Aug 5 14:02:46 2010 +0200

    only try to terminate the daemon when it's running
    
    * tests/sapwood-wrapper: check if the daemon is running before trying to
      terminate it

 tests/sapwood-wrapper |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/tests/sapwood-wrapper b/tests/sapwood-wrapper
index 0f80780..29e40df 100755
--- a/tests/sapwood-wrapper
+++ b/tests/sapwood-wrapper
@@ -5,8 +5,8 @@
 export TMPDIR="`mktemp -d`"
 
 if test $# -eq 0; then
-        echo "Usage: $0 <command> [args]" >&2
-        return 1
+    echo "Usage: $0 <command> [args]" >&2
+    return 1
 fi
 
 sleep 1 # wait for xvfb to be ready
@@ -17,5 +17,9 @@ sleep 1 # wait for sapwood-server to be ready
 $@
 result=$?
 
-kill %- # %- : last job started : http://tldp.org/LDP/abs/html/x8885.html#JOBIDTABLE
+if test $(jobs | wc -l) -gt 0; then
+    kill %- # %- : last job started : http://tldp.org/LDP/abs/html/x8885.html#JOBIDTABLE
+fi
 exit $result
+
+# vim:set et sw=4:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]