From 31436edba539f5f20e7752b89e492632f454d958 Mon Sep 17 00:00:00 2001 From: dgaudet Date: Tue, 6 Mar 2007 18:58:37 +0000 Subject: =?UTF-8?q?Use=20signal=200=20rather=20than=20signal.NSIG=20when?= =?UTF-8?q?=20testing=20if=20another=20rdiff-backup=20is=20still=20running?= =?UTF-8?q?.=20=20(Patch=20from=20S=C3=A9bastien=20Maret)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@796 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/rdiff_backup/regress.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'rdiff-backup/rdiff_backup/regress.py') diff --git a/rdiff-backup/rdiff_backup/regress.py b/rdiff-backup/rdiff_backup/regress.py index 9f4b925..601aacb 100644 --- a/rdiff-backup/rdiff_backup/regress.py +++ b/rdiff-backup/rdiff_backup/regress.py @@ -342,11 +342,11 @@ def check_pids(curmir_incs): def pid_running(pid): """True if we know if process with pid is currently running""" - try: os.kill(pid, signal.NSIG) + try: os.kill(pid, 0) except OSError, exc: if exc[0] == errno.ESRCH: return 0 - elif exc[0] == errno.EINVAL: return 1 - Log("Warning: unable to check if PID %d still running" % (pid,), 2) + else: Log("Warning: unable to check if PID %d still running" % (pid,), 2) + return 1 for curmir_rp in curmir_incs: assert Globals.local_connection is curmir_rp.conn -- cgit v1.2.1