+#if defined(unix)
+/*********************************************************************
+ *
+ * Function : deletePidFile
+ *
+ * Description : deletes the pid file with the pid of the main process
+ *
+ * Parameters : -
+ *
+ * Returns : -
+ *
+ *********************************************************************/
+void deletePidFile( void )
+{
+ char pidfile[ 64 ];
+
+ snprintf( pidfile, sizeof(pidfile), "%s/%s", PID_FILE_PATH, PID_FILE_NAME);
+ unlink( pidfile );
+}
+/*********************************************************************
+ *
+ * Function : writePidFile
+ *
+ * Description : writes the pid file with the pid of the main process
+ *
+ * Parameters : -
+ *
+ * Returns : -
+ *
+ *********************************************************************/
+void writePidFile( void )
+{
+ FILE *fp;
+ char pidfile[64];
+
+ snprintf( pidfile, sizeof(pidfile), "%s/%s", PID_FILE_PATH, PID_FILE_NAME);
+ if ((fp = fopen( pidfile,"w")) == NULL )
+ {
+ log_error(LOG_LEVEL_INFO, "can't open pidfile '%s': %E", pidfile);
+ return;
+ }