summaryrefslogtreecommitdiff
path: root/usr.sbin/cron/job.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/cron/job.c')
-rw-r--r--usr.sbin/cron/job.c54
1 files changed, 31 insertions, 23 deletions
diff --git a/usr.sbin/cron/job.c b/usr.sbin/cron/job.c
index 18e96b6e36b..c85c7270d53 100644
--- a/usr.sbin/cron/job.c
+++ b/usr.sbin/cron/job.c
@@ -1,22 +1,27 @@
+/* $OpenBSD: job.c,v 1.3 2001/02/18 19:48:35 millert Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* All rights reserved
+ */
+
+/*
+ * Copyright (c) 1997,2000 by Internet Software Consortium, Inc.
*
- * Distribute freely, except: don't remove my name from the source or
- * documentation (don't take credit for my work), mark your changes (don't
- * get me blamed for your possible bugs), don't alter or remove this
- * notice. May be sold if buildable source is provided to buyer. No
- * warrantee of any kind, express or implied, is included with this
- * software; use at your own risk, responsibility for damages (if any) to
- * anyone resulting from the use of this software rests entirely with the
- * user.
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
*
- * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
- * I'll try to keep a version up to date. I can be reached as follows:
- * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
*/
#if !defined(lint) && !defined(LINT)
-static char rcsid[] = "$Id: job.c,v 1.2 1996/11/01 23:27:36 millert Exp $";
+static char rcsid[] = "$OpenBSD: job.c,v 1.3 2001/02/18 19:48:35 millert Exp $";
#endif
@@ -35,14 +40,15 @@ static job *jhead = NULL, *jtail = NULL;
void
job_add(e, u)
- register entry *e;
- register user *u;
+ entry *e;
+ user *u;
{
- register job *j;
+ job *j;
/* if already on queue, keep going */
- for (j=jhead; j; j=j->next)
- if (j->e == e && j->u == u) { return; }
+ for (j = jhead; j != NULL; j = j->next)
+ if (j->e == e && j->u == u)
+ return;
/* build a job queue element */
if ((j = (job*)malloc(sizeof(job))) == NULL)
@@ -52,8 +58,10 @@ job_add(e, u)
j->u = u;
/* add it to the tail */
- if (!jhead) { jhead=j; }
- else { jtail->next=j; }
+ if (jhead == NULL)
+ jhead = j;
+ else
+ jtail->next = j;
jtail = j;
}
@@ -61,15 +69,15 @@ job_add(e, u)
int
job_runqueue()
{
- register job *j, *jn;
- register int run = 0;
+ job *j, *jn;
+ int run = 0;
- for (j=jhead; j; j=jn) {
+ for (j = jhead; j; j = jn) {
do_command(j->e, j->u);
jn = j->next;
free(j);
run++;
}
jhead = jtail = NULL;
- return run;
+ return (run);
}