diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2001-02-18 19:48:37 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2001-02-18 19:48:37 +0000 |
commit | 9d12880bde356edc1caf95ce9c16eda5cd362a71 (patch) | |
tree | 76105126f0a9e8669fcf6a00b6332268446f91d1 /usr.sbin/cron/job.c | |
parent | 401b427202f6878b62792414313a54831b405451 (diff) |
Update to ISC cron 4.0b1 + our patches. This is now under a BSD license.
I also fixed the signal handlers while I was at it.
Diffstat (limited to 'usr.sbin/cron/job.c')
-rw-r--r-- | usr.sbin/cron/job.c | 54 |
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); } |