File: status-sendpage.patch

package info (click to toggle)
sendpage 1.0.3-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 644 kB
  • sloc: perl: 4,208; sh: 117; makefile: 51; php: 24
file content (41 lines) | stat: -rw-r--r-- 891 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Index: sendpage-1.0.3/sendpage
===================================================================
--- sendpage-1.0.3.orig/sendpage	2008-08-16 19:18:57.000000000 -0700
+++ sendpage-1.0.3/sendpage	2008-08-16 19:19:08.000000000 -0700
@@ -329,7 +329,7 @@
 	my($display)=@_;
 	my(@check,$pc,$pid,$state,$running,$disabled);
 
-	undef $running;
+	$running=1;
 	@check=@pcs;
 	unshift(@check,"");
 	foreach $pc (@check) {
@@ -342,16 +342,17 @@
 		$pid=PidOf($pc,1);
 		if ($pid==0) {
 			$state="Not running";
+			undef $running;
 		}
 		else {
 			undef $!;
 			kill 0, $pid;
 			if ($! == ESRCH) {
 				$state="Stale: not running";
+				undef $running;
 			}
 			else {
 				$state="Running";
-				$running=1;
 			}
 		}
 		printf("%-6d %20s : %s%s\n",$pid,
@@ -360,7 +361,7 @@
 				if ($display);
 	}
 
-	exit(0) if ($display);
+	exit(!defined($running)) if ($display);
 
 	return $running;
 }