/*
 * autostart - start up the distributor if it's not around.
 */

#include <stdio.h>
#include "local.h"

start_distributor ()
{
#ifdef REMOTE_HOST
	exit(1);
#else
	int	pid;

	switch (pid = fork()) {
	case 0:
		(void) setpgrp (0, getpid());
		execl (HEARTS_DIST, "hearts_dist", (char *)0);
		fprintf(stderr, "The hearts server on charon is down.\n\
Please send mail to bug-sipb@athena.mit.edu to let the SIPB know.\n");
		exit (1);
	case -1:
		perror ("fork");
		exit (1);
	default:
		while (wait ((int *)0) != pid)
			;
	}
#endif
}
