usr.sbin/lpr/lpd/lpd.c
/*
 * Make a pass through the printcap database and start printing any
 * files left from the last time the machine went down.
 */
Make a pass through the printcap database and start printing any
files left from the last time the machine went down.
Make a pass through the printcap database and start printing any files left from the last time the machine went down .
static void
startup()
{
	char *buf;
	register char *cp;
	int pid;
	while (cgetnext(&buf, printcapdb) > 0) {
		if (ckqueue(buf) <= 0) {
			free(buf);
			continue;	
		}
		for (cp = buf; *cp; cp++)
			if (*cp == '|' || *cp == ':') {
				*cp = '\0';
				break;
			}
		if (lflag)
			syslog(LOG_INFO, "work for %s", buf);
		if ((pid = fork()) < 0) {
			syslog(LOG_WARNING, "startup: cannot fork");
			mcleanup(0);
		}
		if (!pid) {
			printer = buf;
			cgetclose();
			printjob();
		}
		else free(buf);
	}
}
static void startup ( ) { char * buf ; register char * cp ; int pid ; while ( cgetnext ( & buf , printcapdb ) > 0 ) { if ( ckqueue ( buf ) <= 0 ) { free ( buf ) ; continue ; } for ( cp = buf ; * cp ; cp ++ ) if ( * cp == ' ' || * cp == ' ' ) { * cp = ' \0 ' ; break ; } if ( lflag ) syslog ( LOG_INFO , " " , buf ) ; if ( ( pid = fork ( ) ) < 0 ) { syslog ( LOG_WARNING , " " ) ; mcleanup ( 0 ) ; } if ( ! pid ) { printer = buf ; cgetclose ( ) ; printjob ( ) ; } else free ( buf ) ; } }
Make a pass through the printcap database and start printing any
 files left from the last time the machine went down.
Make a pass through the printcap database and start printing any files left from the last time the machine went down .
/*
	 * Restart the daemons.
	 */ /* no work to do for this printer */ /* NOTREACHED */