[Box Backup-commit] COMMIT r2409 - box/trunk/infrastructure

boxbackup-dev@boxbackup.org boxbackup-dev@boxbackup.org
Tue, 16 Dec 2008 17:37:09 +0000 (GMT)


Author: chris
Date: 2008-12-16 17:37:08 +0000 (Tue, 16 Dec 2008)
New Revision: 2409

Modified:
   box/trunk/infrastructure/makebuildenv.pl.in
Log:
Fix process kill function, fixes [2402] [2404].

Delete stale PID files after killing processes on Windows, as that
fine OS doesn't give them a chance to clean up for themselves.


Modified: box/trunk/infrastructure/makebuildenv.pl.in
===================================================================
--- box/trunk/infrastructure/makebuildenv.pl.in	2008-12-10 01:02:16 UTC (rev 2408)
+++ box/trunk/infrastructure/makebuildenv.pl.in	2008-12-16 17:37:08 UTC (rev 2409)
@@ -405,9 +405,11 @@
 				print TESTFILE <<__E;
 kill_process()
 {
-	test -r testfiles/$1.pid \\
-	&& /bin/kill -0 -f `cat testfiles/$1.pid` \\
-	&& /bin/kill    -f `cat testfiles/$1.pid`
+	if test -r testfiles/\$1.pid; then
+		/bin/kill -0 -f `cat testfiles/\$1.pid` \\
+		&& /bin/kill -f `cat testfiles/\$1.pid`
+		rm testfiles/\$1.pid
+	fi
 }
 __E
 			}
@@ -416,9 +418,9 @@
 				print TESTFILE <<__E;
 kill_process()
 {
-	test -r testfiles/$1.pid \\
-	&& kill -0 `cat testfiles/$1.pid` \\
-	&& kill    `cat testfiles/$1.pid`
+	test -r testfiles/\$1.pid \\
+	&& kill -0 `cat testfiles/\$1.pid` \\
+	&& kill    `cat testfiles/\$1.pid`
 }
 __E
 			}