projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
uncuddle brackets
[oweals/busybox.git]
/
miscutils
/
crond.c
diff --git
a/miscutils/crond.c
b/miscutils/crond.c
index eea34b963651c377437cdebd457783b7c027980a..4d479bc0d3ba00197dbf0dae73292e7245720279 100644
(file)
--- a/
miscutils/crond.c
+++ b/
miscutils/crond.c
@@
-1,3
+1,4
@@
+/* vi: set sw=4 ts=4: */
/*
* crond -d[#] -c <crondir> -f -b
*
/*
* crond -d[#] -c <crondir> -f -b
*
@@
-196,9
+197,7
@@
int crond_main(int ac, char **av)
* change directory
*/
* change directory
*/
- if (chdir(CDir) != 0) {
- bb_perror_msg_and_die("%s", CDir);
- }
+ bb_xchdir(CDir);
signal(SIGHUP, SIG_IGN); /* hmm.. but, if kill -HUP original
* version - his died. ;(
*/
signal(SIGHUP, SIG_IGN); /* hmm.. but, if kill -HUP original
* version - his died. ;(
*/
@@
-213,9
+212,7
@@
int crond_main(int ac, char **av)
/* reexec for vfork() do continue parent */
vfork_daemon_rexec(1, 0, ac, av, "-f");
#else /* uClinux */
/* reexec for vfork() do continue parent */
vfork_daemon_rexec(1, 0, ac, av, "-f");
#else /* uClinux */
- if (daemon(1, 0) < 0) {
- bb_perror_msg_and_die("daemon");
- }
+ bb_xdaemon(1, 0);
#endif /* uClinux */
}
#endif /* uClinux */
}
@@
-235,7
+232,7
@@
int crond_main(int ac, char **av)
time_t t1 = time(NULL);
time_t t2;
long dt;
time_t t1 = time(NULL);
time_t t2;
long dt;
-
shor
t rescan = 60;
+
in
t rescan = 60;
short sleep_time = 60;
for (;;) {
short sleep_time = 60;
for (;;) {
@@
-532,17
+529,17
@@
static char *ParseField(char *user, char *ary, int modvalue, int off,
static void FixDayDow(CronLine * line)
{
static void FixDayDow(CronLine * line)
{
-
shor
t i;
-
shor
t weekUsed = 0;
-
shor
t daysUsed = 0;
+
in
t i;
+
in
t weekUsed = 0;
+
in
t daysUsed = 0;
- for (i = 0; i <
arysize(line->cl_Dow
); ++i) {
+ for (i = 0; i <
(int)(arysize(line->cl_Dow)
); ++i) {
if (line->cl_Dow[i] == 0) {
weekUsed = 1;
break;
}
}
if (line->cl_Dow[i] == 0) {
weekUsed = 1;
break;
}
}
- for (i = 0; i <
arysize(line->cl_Days
); ++i) {
+ for (i = 0; i <
(int)(arysize(line->cl_Days)
); ++i) {
if (line->cl_Days[i] == 0) {
daysUsed = 1;
break;
if (line->cl_Days[i] == 0) {
daysUsed = 1;
break;
@@
-769,7
+766,7
@@
static void DeleteFile(const char *userName)
static int TestJobs(time_t t1, time_t t2)
{
static int TestJobs(time_t t1, time_t t2)
{
-
shor
t nJobs = 0;
+
in
t nJobs = 0;
time_t t;
/* Find jobs > t1 and <= t2 */
time_t t;
/* Find jobs > t1 and <= t2 */