-/* $OpenBSD: atrun.c,v 1.24 2015/01/19 01:05:32 deraadt Exp $ */
+/* $OpenBSD: atrun.c,v 1.25 2015/01/22 22:38:55 tedu Exp $ */
/*
* Copyright (c) 2002-2003 Todd C. Miller <Todd.Miller@courtesan.com>
continue;
queue = (unsigned char)ep[1];
- job = (atjob *)malloc(sizeof(*job));
+ job = malloc(sizeof(*job));
if (job == NULL) {
for (job = new_db.head; job != NULL; ) {
tjob = job;
log_close();
/* Connect grandchild's stdin to the at job file. */
- if (lseek(fd, (off_t) 0, SEEK_SET) < 0) {
+ if (lseek(fd, 0, SEEK_SET) < 0) {
perror("lseek");
_exit(EXIT_FAILURE);
}
-/* $OpenBSD: cron.c,v 1.47 2015/01/14 17:27:29 millert Exp $ */
+/* $OpenBSD: cron.c,v 1.48 2015/01/22 22:38:55 tedu Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* All rights reserved
cronSock = open_socket();
database.head = NULL;
database.tail = NULL;
- database.mtime = (time_t) 0;
+ database.mtime = 0;
load_database(&database);
at_database.head = NULL;
at_database.tail = NULL;
- at_database.mtime = (time_t) 0;
+ at_database.mtime = 0;
scan_atjobs(&at_database, NULL);
set_time(TRUE);
run_reboot_jobs(&database);
(void) read(fd, &poke, 1);
close(fd);
if (poke & RELOAD_CRON) {
- database.mtime = (time_t)0;
+ database.mtime = 0;
load_database(&database);
}
if (poke & RELOAD_AT) {
* jobs immediately.
*/
gettimeofday(&t2, NULL);
- at_database.mtime = (time_t)0;
+ at_database.mtime = 0;
if (scan_atjobs(&at_database, &t2))
atrun(&at_database,
batch_maxload, t2.tv_sec);
-/* $OpenBSD: entry.c,v 1.35 2015/01/14 17:27:51 millert Exp $ */
+/* $OpenBSD: entry.c,v 1.36 2015/01/22 22:38:55 tedu Exp $ */
/*
* Copyright 1988,1990,1993,1994 by Paul Vixie
* of a list of minutes.
*/
- e = (entry *) calloc(sizeof(entry), sizeof(char));
+ e = calloc(sizeof(entry), sizeof(char));
if (e == NULL) {
ecode = e_memory;
goto eof;
-/* $OpenBSD: job.c,v 1.8 2009/10/27 23:59:51 deraadt Exp $ */
+/* $OpenBSD: job.c,v 1.9 2015/01/22 22:38:55 tedu Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* All rights reserved
return;
/* build a job queue element */
- if ((j = (job *)malloc(sizeof(job))) == NULL)
+ if ((j = malloc(sizeof(job))) == NULL)
return;
j->next = NULL;
j->e = e;
-/* $OpenBSD: misc.c,v 1.50 2015/01/14 17:27:30 millert Exp $ */
+/* $OpenBSD: misc.c,v 1.51 2015/01/22 22:38:55 tedu Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* All rights reserved
}
snprintf(buf, sizeof(buf), "%ld\n", (long)getpid());
- (void) lseek(fd, (off_t)0, SEEK_SET);
+ (void) lseek(fd, 0, SEEK_SET);
num = write(fd, buf, strlen(buf));
- (void) ftruncate(fd, (off_t)num);
+ (void) ftruncate(fd, num);
/* abandon fd even though the file is open. we need to keep
* it open and locked, but we don't need the handles elsewhere.
while (EOF != (ch = get_char(file)) && !strchr(terms, ch)) {
if (size > 1) {
- *string++ = (char) ch;
+ *string++ = ch;
size--;
}
}
-/* $OpenBSD: user.c,v 1.8 2009/10/27 23:59:51 deraadt Exp $ */
+/* $OpenBSD: user.c,v 1.9 2015/01/22 22:38:55 tedu Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* All rights reserved
/* file is open. build user entry, then read the crontab file.
*/
- if ((u = (user *) malloc(sizeof(user))) == NULL)
+ if ((u = malloc(sizeof(user))) == NULL)
return (NULL);
if ((u->name = strdup(name)) == NULL) {
save_errno = errno;