FreeBSD/contrib/blacklist/port/pidfile.c
/* Given a new pidfile name in 'path', deletes any previously-created pidfile
 * if the previous file differs to the new one.
 *
 * If a previous file is deleted, returns 1, which means that a new pidfile
 * must be created.  Otherwise, this returns 0, which means that the existing
 * file does not need to be touched. */
Given a new pidfile name in 'path', deletes any previously-created pidfile
if the previous file differs to the new one.

If a previous file is deleted, returns 1, which means that a new pidfile
must be created.  Otherwise, this returns 0, which means that the existing
file does not need to be touched.
Given a new pidfile name in ' path ' deletes any previously - created pidfile if the previous file differs to the new one . If a previous file is deleted returns 1 which means that a new pidfile must be created . Otherwise this returns 0 which means that the existing file does not need to be touched .
static int
cleanup_old_pidfile(const char* path)
{
	if (pidfile_path != NULL) {
		if (strcmp(pidfile_path, path) != 0) {
			pidfile_cleanup();
			free(pidfile_path);
			pidfile_path = NULL;
			return 1;
		} else
			return 0;
	} else
		return 1;
}
static int cleanup_old_pidfile ( const char * path ) { if ( pidfile_path != NULL ) { if ( strcmp ( pidfile_path , path ) != 0 ) { pidfile_cleanup ( ) ; free ( pidfile_path ) ; pidfile_path = NULL ; return 1 ; } else return 0 ; } else return 1 ; }
Given a new pidfile name in 'path', deletes any previously-created pidfile
 if the previous file differs to the new one.
Given a new pidfile name in ' path ' deletes any previously - created pidfile if the previous file differs to the new one .