]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Fix pid_file_proc which was retuning a null
authorMike Brady <mikebrady@eircom.net>
Mon, 12 Jun 2017 13:48:37 +0000 (14:48 +0100)
committerMike Brady <mikebrady@eircom.net>
Mon, 12 Jun 2017 13:48:37 +0000 (14:48 +0100)
shairport.c

index c26990d39009a2697c35347944eb79dd9d005140..664ed35758f2ae33a525b11191161315cb072c2f 100644 (file)
@@ -915,21 +915,19 @@ void shairport_startup_complete(void) {
 
 
 const char *pid_file_proc(void) {
-#ifdef USE_CUSTOM_PID_DIR
-char * use_this_pid_dir = PIDDIR;
-#else
-char * use_this_pid_dir = "/var/run/shairport-sync";
-#endif
-// debug(1,"config.piddir \"%s\".",config.piddir);
-if (config.piddir)
-  use_this_pid_dir = config.piddir;
-  char fn[8192];
-  snprintf(fn, sizeof(fn), "%s/%s.pid", use_this_pid_dir,
-           daemon_pid_file_ident ? daemon_pid_file_ident : "unknown");
-  // debug(1,"fn \"%s\".",fn);
-  char *realPidFilePath = realpath(fn, NULL);
-  // debug(1,"PID file path \"%s\".",realPidFilePath);
-  return realPidFilePath;
+       #ifdef USE_CUSTOM_PID_DIR
+       char * use_this_pid_dir = PIDDIR;
+       #else
+       char * use_this_pid_dir = "/var/run/shairport-sync";
+       #endif
+       // debug(1,"config.piddir \"%s\".",config.piddir);
+       if (config.piddir)
+               use_this_pid_dir = config.piddir;
+       char fn[8192];
+       snprintf(fn, sizeof(fn), "%s/%s.pid", use_this_pid_dir,
+                                                daemon_pid_file_ident ? daemon_pid_file_ident : "unknown");
+       //debug(1,"fn \"%s\".",fn);
+       return strdup(fn);
 }
 
 void exit_function() {
@@ -1267,7 +1265,6 @@ int main(int argc, char **argv) {
   }
 
   /* Print out options */
-
   debug(1, "statistics_requester status is %d.", config.statistics_requested);
   debug(1, "daemon status is %d.", config.daemonise);
   debug(1, "deamon pid file is \"%s\".",pid_file_proc());