From 5ecef433e71d124991201bf97feffd45cb23f8ff Mon Sep 17 00:00:00 2001 From: John Hodge Date: Mon, 19 Mar 2012 21:31:14 +0800 Subject: [PATCH] Server - Deduplicated PIDfile name --- src/server/server.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server/server.c b/src/server/server.c index 63b4aa7..98b0325 100644 --- a/src/server/server.c +++ b/src/server/server.c @@ -25,6 +25,8 @@ #define DEBUG_TRACE_CLIENT 0 #define HACK_NO_REFUNDS 1 +#define PIDFILE "/var/run/dispsrv.pid" + // Statistics #define MAX_CONNECTION_QUEUE 5 #define INPUT_BUFFER_SIZE 256 @@ -215,7 +217,7 @@ void Server_Start(void) // write pidfile { - FILE *fp = fopen("/var/run/dispsrv.pid", "w"); + FILE *fp = fopen(PIDFILE, "w"); if( fp ) { fprintf(fp, "%i", getpid()); fclose(fp); @@ -307,7 +309,7 @@ void Server_Cleanup(void) { printf("\nClose(%i)\n", giServer_Socket); close(giServer_Socket); - unlink("/var/run/dispsrv.pid"); + unlink(PIDFILE); } /** -- 2.20.1