summaryrefslogtreecommitdiff
path: root/mbone/dbeacon/patches/patch-aa
diff options
context:
space:
mode:
Diffstat (limited to 'mbone/dbeacon/patches/patch-aa')
-rw-r--r--mbone/dbeacon/patches/patch-aa35
1 files changed, 35 insertions, 0 deletions
diff --git a/mbone/dbeacon/patches/patch-aa b/mbone/dbeacon/patches/patch-aa
new file mode 100644
index 00000000000..ab5b7bfcbe4
--- /dev/null
+++ b/mbone/dbeacon/patches/patch-aa
@@ -0,0 +1,35 @@
+$NetBSD: patch-aa,v 1.1 2008/08/26 17:18:14 seb Exp $
+
+--- dbeacon.cpp.orig 2007-07-13 13:52:14.000000000 +0000
++++ dbeacon.cpp
+@@ -176,7 +176,7 @@ bool daemonize = false;
+ bool use_syslog = false;
+ bool past_init = false;
+
+-const char *pidfile = NULL;
++static string pidfile;
+
+ static void next_event(timeval *);
+ static void insert_event(uint32_t, uint32_t);
+@@ -464,8 +464,8 @@ int main(int argc, char **argv) {
+ perror("Failed to daemon()ize.");
+ return -1;
+ }
+- if (pidfile) {
+- FILE *f = fopen(pidfile, "w");
++ if (!pidfile.empty()) {
++ FILE *f = fopen(pidfile.c_str(), "w");
+ if (f) {
+ fprintf(f, "%u\n", getpid());
+ fclose(f);
+@@ -1657,8 +1657,8 @@ void dumpBigBwStats(int) {
+
+ void sendLeaveReport(int) {
+ send_report(LEAVE_REPORT);
+- if (daemonize && pidfile)
+- unlink(pidfile);
++ if (daemonize && !pidfile.empty())
++ unlink(pidfile.c_str());
+ exit(0);
+ }
+