Example #1
0
static int
runner_message_to_scheduler(u_int32_t msgid)
{
	struct qwalk	*q;
	u_int64_t	 evpid;
	struct envelope	 envelope;
	struct scheduler_info	si;

	q = qwalk_new(msgid);
	while (qwalk(q, &evpid)) {
		if (! queue_envelope_load(evpid, &envelope))
			continue;
		scheduler_info(&si, &envelope);
		scheduler->insert(&si);
	}
 	qwalk_close(q);

	return 1;
}
Example #2
0
static void
show_queue(int flags)
{
	struct qwalk	*q;
	struct envelope	 envelope;
	u_int64_t	 evpid;

	log_init(1);

	if (chroot(PATH_SPOOL) == -1 || chdir(".") == -1)
		err(1, "%s", PATH_SPOOL);

	q = qwalk_new(0);

	while (qwalk(q, &evpid)) {
		if (! queue_envelope_load(evpid, &envelope))
			continue;
		show_envelope(&envelope, flags);
	}

	qwalk_close(q);
}