1 |
Author: grobian |
2 |
Date: 2011-03-31 14:12:48 +0000 (Thu, 31 Mar 2011) |
3 |
New Revision: 1690 |
4 |
|
5 |
Modified: |
6 |
trunk/baselayout-prefix/src/start-stop-daemon.c |
7 |
Log: |
8 |
applied baselayout-1.12.5-solaris.patch |
9 |
|
10 |
Based on haubi's AIX patch, implement for Solaris |
11 |
|
12 |
Modified: trunk/baselayout-prefix/src/start-stop-daemon.c |
13 |
=================================================================== |
14 |
--- trunk/baselayout-prefix/src/start-stop-daemon.c 2011-03-31 14:12:39 UTC (rev 1689) |
15 |
+++ trunk/baselayout-prefix/src/start-stop-daemon.c 2011-03-31 14:12:48 UTC (rev 1690) |
16 |
@@ -44,7 +44,7 @@ |
17 |
# define OSLinux |
18 |
#elif defined(__GNU__) |
19 |
# define OSHURD |
20 |
-#elif defined(__sparc__) |
21 |
+#elif defined (__SVR4) && defined (__sun) |
22 |
# define OSsunos |
23 |
#elif defined(OPENBSD) || defined(__OpenBSD__) |
24 |
# define OSOpenBSD |
25 |
@@ -94,6 +94,9 @@ |
26 |
#if defined(OSaix) |
27 |
#include <sys/procfs.h> |
28 |
#endif |
29 |
+#if defined(OSsunos) |
30 |
+#include <procfs.h> |
31 |
+#endif |
32 |
|
33 |
#include <errno.h> |
34 |
#include <stdio.h> |
35 |
@@ -188,7 +191,7 @@ |
36 |
static void do_pidfile(const char *name); |
37 |
static void do_stop(int signal_nr, int quietmode, |
38 |
int *n_killed, int *n_notkilled, int retry_nr); |
39 |
-#if defined(OSLinux) || defined(OShpux) || defined(OSaix) |
40 |
+#if defined(OSLinux) || defined(OShpux) || defined(OSaix) || defined(OSsunos) |
41 |
static int pid_is_exec(pid_t pid, const struct stat *esb); |
42 |
#endif |
43 |
|
44 |
@@ -765,7 +768,7 @@ |
45 |
static void |
46 |
check(pid_t pid) |
47 |
{ |
48 |
-#if defined(OSLinux) || defined(OShpux) || defined(OSaix) |
49 |
+#if defined(OSLinux) || defined(OShpux) || defined(OSaix) || defined(OSsunos) |
50 |
if (execname && !pid_is_exec(pid, &exec_stat)) |
51 |
return; |
52 |
#elif defined(OSHURD) || defined(OSFreeBSD) || defined(OSNetBSD) || defined(OSDarwin) |
53 |
@@ -801,7 +804,7 @@ |
54 |
/* WTA: this needs to be an autoconf check for /proc/pid existance. |
55 |
*/ |
56 |
|
57 |
-#if defined(OSLinux) || defined (OSsunos) || defined(OSfreebsd) || defined(OSaix) |
58 |
+#if defined(OSLinux) || defined (OSsunos) || defined(OSfreebsd) || defined(OSaix) || defined(OSsunos) |
59 |
static void |
60 |
do_procinit(void) |
61 |
{ |
62 |
@@ -1069,7 +1072,7 @@ |
63 |
} |
64 |
#endif /* OShpux */ |
65 |
|
66 |
-#if defined(OSaix) |
67 |
+#if defined(OSaix) || defined(OSsunos) |
68 |
/* max possible pid (signed long) in theory: |
69 |
* 32bit: 2147483647 (10 digits) |
70 |
* 64bit: 9223372036854775807 (19 digits) |
71 |
@@ -1119,7 +1122,7 @@ |
72 |
} |
73 |
return strcmp(name, psi.pr_fname) == 0; |
74 |
} |
75 |
-#endif /* OSaix */ |
76 |
+#endif /* OSaix || OSsunos */ |
77 |
|
78 |
|
79 |
static void |