aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/cron/cron/job.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/cron/cron/job.c')
-rw-r--r--usr.sbin/cron/cron/job.c57
1 files changed, 29 insertions, 28 deletions
diff --git a/usr.sbin/cron/cron/job.c b/usr.sbin/cron/cron/job.c
index 6d1b1af6e474..9579cd9d755d 100644
--- a/usr.sbin/cron/cron/job.c
+++ b/usr.sbin/cron/cron/job.c
@@ -1,24 +1,24 @@
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* All rights reserved
+ */
+
+/*
+ * Copyright (c) 1997 by Internet Software Consortium
*
- * 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 const char rcsid[] =
- "$FreeBSD$";
-#endif
#include "cron.h"
@@ -35,15 +35,14 @@ static job *jhead = NULL, *jtail = NULL;
void
-job_add(e, u)
- register entry *e;
- register user *u;
+job_add(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)
@@ -53,24 +52,26 @@ 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;
}
int
-job_runqueue()
+job_runqueue(void)
{
- 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);
}