if (rc) return -1; else return 0;
if (WIFEXITED(rc)) return WEXITSTATUS(rc); else return -1;
int startDaemon() {    int pid;    int rc;        if ( (pid = fork()) == -1 ) {	perror("fork");	return -1;    }    if ( pid ) {	/* parent */	waitpid(pid,&rc,0);        if (rc)	 return -1;        else 	 return 0;    } else {	int fd;		fd=open("/dev/null",O_RDWR);	dup2(fd,0);	dup2(fd,1);	dup2(fd,2);	/* kid */	execlp("minilogd","minilogd",NULL);	perror("exec");	exit(-1);    }}