1 /* Copyright 1988,1990,1993,1994 by Paul Vixie
4 * Distribute freely, except: don't remove my name from the source or
5 * documentation (don't take credit for my work), mark your changes (don't
6 * get me blamed for your possible bugs), don't alter or remove this
7 * notice. May be sold if buildable source is provided to buyer. No
8 * warrantee of any kind, express or implied, is included with this
9 * software; use at your own risk, responsibility for damages (if any) to
10 * anyone resulting from the use of this software rests entirely with the
13 * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
14 * I'll try to keep a version up to date. I can be reached as follows:
15 * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
17 * $FreeBSD: src/usr.sbin/cron/cron/job.c,v 1.6 1999/08/28 01:15:50 peter Exp $
18 * $DragonFly: src/usr.sbin/cron/cron/job.c,v 1.4 2004/03/10 18:27:26 dillon Exp $
31 static job *jhead = NULL, *jtail = NULL;
35 job_add(entry *e, user *u)
39 /* if already on queue, keep going */
40 for (j=jhead; j; j=j->next)
41 if (j->e == e && j->u == u) { return; }
43 /* build a job queue element */
44 if ((j = (job*)malloc(sizeof(job))) == NULL)
50 /* add it to the tail */
51 if (!jhead) { jhead=j; }
52 else { jtail->next=j; }
63 for (j=jhead; j; j=jn) {
64 do_command(j->e, j->u);