Diff of /daemonize.c [ccc324] .. [1de4ef] Maximize Restore

  Switch to side-by-side view

--- a/daemonize.c
+++ b/daemonize.c
@@ -87,41 +87,6 @@
 }
 
 int
-writepidfile(const char * fname, int pid)
-{
-	char pidstring[16];
-	int pidstringlen;
-	int pidfile;
-
-	if(!fname || *fname == '\0')
-		return -1;
-	
-	if( (pidfile = open(fname, O_WRONLY|O_CREAT, 0644)) < 0)
-	{
-		DPRINTF(E_ERROR, L_GENERAL, "Unable to open pidfile for writing %s: %s\n", fname, strerror(errno));
-		return -1;
-	}
-
-	pidstringlen = snprintf(pidstring, sizeof(pidstring), "%d\n", pid);
-	if(pidstringlen <= 0)
-	{
-		DPRINTF(E_ERROR, L_GENERAL, 
-			"Unable to write to pidfile %s: snprintf(): FAILED\n", fname);
-		close(pidfile);
-		return -1;
-	}
-	else
-	{
-		if(write(pidfile, pidstring, pidstringlen) < 0)
-			DPRINTF(E_ERROR, L_GENERAL, "Unable to write to pidfile %s: %s\n", fname, strerror(errno));
-	}
-
-	close(pidfile);
-
-	return 0;
-}
-
-int
 checkforrunning(const char * fname)
 {
 	char buffer[64];