[BACK]Return to patch-aa CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / mbone / dbeacon / patches

File: [cvs.NetBSD.org] / pkgsrc / mbone / dbeacon / patches / Attic / patch-aa (download)

Revision 1.1, Tue Aug 26 17:18:14 2008 UTC (14 years, 1 month ago) by seb
Branch: MAIN
CVS Tags: pkgsrc-2014Q3-base, pkgsrc-2014Q3, pkgsrc-2014Q2-base, pkgsrc-2014Q2, pkgsrc-2014Q1-base, pkgsrc-2014Q1, pkgsrc-2013Q4-base, pkgsrc-2013Q4, pkgsrc-2013Q3-base, pkgsrc-2013Q3, pkgsrc-2013Q2-base, pkgsrc-2013Q2, pkgsrc-2013Q1-base, pkgsrc-2013Q1, pkgsrc-2012Q4-base, pkgsrc-2012Q4, pkgsrc-2012Q3-base, pkgsrc-2012Q3, pkgsrc-2012Q2-base, pkgsrc-2012Q2, pkgsrc-2012Q1-base, pkgsrc-2012Q1, pkgsrc-2011Q4-base, pkgsrc-2011Q4, pkgsrc-2011Q3-base, pkgsrc-2011Q3, pkgsrc-2011Q2-base, pkgsrc-2011Q2, pkgsrc-2011Q1-base, pkgsrc-2011Q1, pkgsrc-2010Q4-base, pkgsrc-2010Q4, pkgsrc-2010Q3-base, pkgsrc-2010Q3, pkgsrc-2010Q2-base, pkgsrc-2010Q2, pkgsrc-2010Q1-base, pkgsrc-2010Q1, pkgsrc-2009Q4-base, pkgsrc-2009Q4, pkgsrc-2009Q3-base, pkgsrc-2009Q3, pkgsrc-2009Q2-base, pkgsrc-2009Q2, pkgsrc-2009Q1-base, pkgsrc-2009Q1, pkgsrc-2008Q4-base, pkgsrc-2008Q4, pkgsrc-2008Q3-base, pkgsrc-2008Q3, cube-native-xorg-base, cube-native-xorg

Fix pidfile option handling (in configuration file case).
Bump PKGREVISION to 1.

$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);
 }