(void)__db_sleep(seconds, 0);
main(argc, argv)	int argc;	char *argv[];{	extern char *optarg;	extern int optind;	DB_ENV *dbenv;	time_t now;	long kbytes, minutes, seconds;	int ch, eval, verbose;	char *home, *logfile;	home = logfile = NULL;	kbytes = minutes = 0;	verbose = 0;	while ((ch = getopt(argc, argv, "h:k:L:p:v")) != EOF)		switch (ch) {		case 'h':			home = optarg;			break;		case 'k':			get_long(optarg, 1, LONG_MAX, &kbytes);			break;		case 'L':			logfile = optarg;			break;		case 'p':			get_long(optarg, 1, LONG_MAX, &minutes);			break;		case 'v':			verbose = 1;			break;		case '?':		default:			usage();		}	argc -= optind;	argv += optind;	if (argc != 0)		usage();	if (kbytes == 0 && minutes == 0) {		warnx("at least one of -k and -p must be specified");		usage();	}	/* Initialize the environment. */	dbenv = db_init(home);	if (logfile != NULL && logpid(logfile, 1)) {		(void)db_appexit(dbenv);		return (1);	}	/*	 * If we have only a time delay, then we'll sleep the right amount	 * to wake up when a checkpoint is necessary.  If we have a "kbytes"	 * field set, then we'll check every 30 seconds.	 */	eval = 0;	seconds = kbytes != 0 ? 30 : minutes * 60;	while (!interrupted) {		(void)__db_sleep(seconds, 0);		if (verbose) {			(void)time(&now);			printf("checkpoint: %s", ctime(&now));		}		errno = txn_checkpoint(dbenv->tx_info, kbytes, minutes);		while (errno == DB_INCOMPLETE) {			if (verbose)				__db_err(dbenv,				    "checkpoint did not finish, retrying");			(void)__db_sleep(2, 0);			errno = txn_checkpoint(dbenv->tx_info, 0, 0);		}		if (errno != 0) {			eval = 1;			__db_err(dbenv, "checkpoint: %s", strerror(errno));			break;		}	}	if (logfile != NULL && logpid(logfile, 0))		eval = 1;	if (interrupted) {		(void)signal(interrupted, SIG_DFL);		(void)raise(interrupted);		/* NOTREACHED */	}	return (db_appexit(dbenv) || eval ? 1 : 0);}