From fbe365dc4409b2e24e62491fb3a58ab17a08d7a8 Mon Sep 17 00:00:00 2001 From: Stephen L Johnson Date: Mon, 10 Jun 2002 20:31:20 +0000 Subject: [PATCH] added ps checks in already_running() to make sure process is a spong-client process before exiting --- src/spong-client.pl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/spong-client.pl b/src/spong-client.pl index 0d8b7da..990a9c9 100755 --- a/src/spong-client.pl +++ b/src/spong-client.pl @@ -12,7 +12,7 @@ # History: # (1) Ported bb-local.sh script to perl. (Ed Hill Feb 26, 1997) # -# $Id: spong-client.pl,v 1.20 2002/01/17 17:02:12 sljohnson Exp $ +# $Id: spong-client.pl,v 1.21 2002/06/10 20:31:20 sljohnson Exp $ use lib '@@LIBDIR@@'; @@ -219,8 +219,11 @@ sub already_running { close PID; if ( kill 0,$pid ) { - &error("Spong-client is already running as pid $pid"); - exit 1; + `ps -fp $pid | grep spong-client >/dev/null`; + if ( ! $? ) { + &error("Spong-client is already running as pid $pid"); + exit 1; + } } } } -- 2.30.2