FreeBSD/contrib/blacklist/port/pidfile.c
/* Constructs a name for a pidfile in the default location (/var/run).  If
 * 'basename' is NULL, uses the name of the current program for the name of
 * the pidfile.
 *
 * Returns a pointer to a dynamically-allocatd string containing the absolute
 * path to the pidfile; NULL on failure. */
Constructs a name for a pidfile in the default location (/var/run).  If
'basename' is NULL, uses the name of the current program for the name of
the pidfile.

Returns a pointer to a dynamically-allocatd string containing the absolute
path to the pidfile; NULL on failure.
Constructs a name for a pidfile in the default location ( / var / run ) . If ' basename ' is NULL uses the name of the current program for the name of the pidfile . Returns a pointer to a dynamically - allocatd string containing the absolute path to the pidfile ; NULL on failure .
static char *
generate_varrun_path(const char *bname)
{
	char *path;
	if (bname == NULL)
		bname = getprogname();
	if (asprintf(&path, "%s%s.pid", _PATH_VARRUN, bname) == -1)
		return NULL;
	return path;
}
static char * generate_varrun_path ( const char * bname ) { char * path ; if ( bname == NULL ) bname = getprogname ( ) ; if ( asprintf ( & path , " " , _PATH_VARRUN , bname ) == -1 ) return NULL ; return path ; }
Constructs a name for a pidfile in the default location (/var/run).
Constructs a name for a pidfile in the default location ( / var / run ) .
/* _PATH_VARRUN includes trailing / */