Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 69157 Details for
Bug 107076
app-admin/collectd (new ebuild)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
pidfile-2.1.0.patch - creates a pidfile
pidfile-2.1.0.patch (text/plain), 995 bytes, created by
Tommie
on 2005-09-24 04:35:08 UTC
(
hide
)
Description:
pidfile-2.1.0.patch - creates a pidfile
Filename:
MIME Type:
Creator:
Tommie
Created:
2005-09-24 04:35:08 UTC
Size:
995 bytes
patch
obsolete
>diff -Nru collectd-2.1.0-orig/src/collectd.c collectd-2.1.0/src/collectd.c >--- collectd-2.1.0-orig/src/collectd.c 2005-09-15 22:35:14.000000000 +0200 >+++ collectd-2.1.0/src/collectd.c 2005-09-24 10:34:13.000000000 +0200 >@@ -16,6 +16,9 @@ > kstat_ctl_t *kc; > #endif /* HAVE_LIBKSTAT */ > >+#define PID_PATH "/var/run/collectd.pid" >+ >+ > void sigIntHandler (int signal) > { > loop++; >@@ -166,6 +169,27 @@ > exit (0); > } > >+static int create_pidfile (void) >+{ >+ FILE *fh = fopen (PID_PATH, "w"); >+ >+ if (!fh) >+ { >+ syslog (LOG_ERR, "fopen (pidfile): %s", strerror (errno)); >+ return 1; >+ } >+ >+ fprintf(fh, "%d\n", getpid()); >+ fclose(fh); >+ >+ return 0; >+} >+ >+static int remove_pidfile (void) >+{ >+ return unlink (PID_PATH); >+} >+ > int main (int argc, char **argv) > { > int sleepingtime; >@@ -253,6 +277,9 @@ > } > #endif > >+ if (create_pidfile ()) >+ exit (2); >+ > /* child */ > while (loop == 0) > { >@@ -304,6 +331,8 @@ > > /* close syslog */ > closelog (); >+ >+ remove_pidfile(); > > return (0); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 107076
:
69154
|
69155
|
69156
|
69157
|
69171
|
69172
|
70664
|
70665
|
70667
|
71047
|
71048
|
71049
|
71050
|
71051
|
71274
|
72852
|
72853
|
74995
|
74996
|
74997
|
74998
|
74999
|
75109
|
75110
|
78563
|
78564
|
78565
|
78566
|
78567
|
79018
|
111075
|
111077
|
111079
|
123746
|
123749
|
146843
|
146845
|
146846
|
148498
|
150796
|
162497
|
162499
|
162500
|
162502
|
162586
|
217235
|
217390
|
241023