projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
date and time created 82/04/02 10:29:00 by wnj
[unix-history]
/
usr
/
src
/
usr.sbin
/
cron
/
cron.c
diff --git
a/usr/src/usr.sbin/cron/cron.c
b/usr/src/usr.sbin/cron/cron.c
index
463b710
..
422b859
100644
(file)
--- a/
usr/src/usr.sbin/cron/cron.c
+++ b/
usr/src/usr.sbin/cron/cron.c
@@
-1,4
+1,4
@@
-static char *sccsid = "@(#)cron.c 4.
1
(Berkeley) %G%";
+static char *sccsid = "@(#)cron.c 4.
3
(Berkeley) %G%";
#include <sys/types.h>
#include <stdio.h>
#include <ctype.h>
#include <sys/types.h>
#include <stdio.h>
#include <ctype.h>
@@
-8,11
+8,11
@@
static char *sccsid = "@(#)cron.c 4.1 (Berkeley) %G%";
#define LISTS 512
#define LISTS 512
-#define EXACT 0
-#define ANY 1
-#define LIST 2
-#define RANGE 3
-#define EOS 4
+#define EXACT
10
0
+#define ANY 1
01
+#define LIST
10
2
+#define RANGE
10
3
+#define EOS
10
4
char crontab[] = "/usr/lib/crontab";
time_t itime;
struct tm *loct;
char crontab[] = "/usr/lib/crontab";
time_t itime;
struct tm *loct;
@@
-61,10
+61,8
@@
main()
cp = cmp(cp, loct->tm_mday);
cp = cmp(cp, loct->tm_mon);
cp = cmp(cp, loct->tm_wday);
cp = cmp(cp, loct->tm_mday);
cp = cmp(cp, loct->tm_mon);
cp = cmp(cp, loct->tm_wday);
- if(flag == 0) {
- slp();
+ if(flag == 0)
ex(cp);
ex(cp);
- }
while(*cp++ != 0)
;
}
while(*cp++ != 0)
;
}
@@
-115,6
+113,11
@@
slp()
time(&t);
i = itime - t;
time(&t);
i = itime - t;
+ if(i < -60 * 60 || i > 60 * 60) {
+ itime = t;
+ i = 60 - localtime(&itime)->tm_sec;
+ itime += i;
+ }
if(i > 0)
sleep(i);
}
if(i > 0)
sleep(i);
}