Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/cron Kill __P(), use ANSI function declarations, co...
details: https://anonhg.NetBSD.org/src/rev/75558700244e
branches: trunk
changeset: 574882:75558700244e
user: xtraeme <xtraeme%NetBSD.org@localhost>
date: Wed Mar 16 02:53:55 2005 +0000
description:
Kill __P(), use ANSI function declarations, constify; WARNS=3
diffstat:
usr.sbin/cron/Makefile | 4 +-
usr.sbin/cron/compat.c | 28 +++++---------
usr.sbin/cron/compat.h | 6 +--
usr.sbin/cron/cron.c | 48 +++++++++---------------
usr.sbin/cron/cron.h | 88 +++++++++++++++++++++++-----------------------
usr.sbin/cron/crontab.c | 54 +++++++++++----------------
usr.sbin/cron/database.c | 34 +++++------------
usr.sbin/cron/do_command.c | 19 +++------
usr.sbin/cron/entry.c | 64 ++++++++++++++------------------
usr.sbin/cron/env.c | 24 ++++--------
usr.sbin/cron/externs.h | 20 +++++-----
usr.sbin/cron/job.c | 15 +++----
usr.sbin/cron/misc.c | 78 +++++++++++++---------------------------
usr.sbin/cron/popen.c | 10 ++---
usr.sbin/cron/user.c | 13 ++----
15 files changed, 203 insertions(+), 302 deletions(-)
diffs (truncated from 1320 to 300 lines):
diff -r c11fd6580fbe -r 75558700244e usr.sbin/cron/Makefile
--- a/usr.sbin/cron/Makefile Wed Mar 16 02:08:52 2005 +0000
+++ b/usr.sbin/cron/Makefile Wed Mar 16 02:53:55 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2003/03/14 21:56:07 christos Exp $
+# $NetBSD: Makefile,v 1.11 2005/03/16 02:53:55 xtraeme Exp $
PROG= cron
SRCS= cron.c database.c do_command.c entry.c env.c job.c \
@@ -7,4 +7,6 @@
LDADD+=-lutil
MAN= cron.8
+WARNS= 3
+
.include <bsd.prog.mk>
diff -r c11fd6580fbe -r 75558700244e usr.sbin/cron/compat.c
--- a/usr.sbin/cron/compat.c Wed Mar 16 02:08:52 2005 +0000
+++ b/usr.sbin/cron/compat.c Wed Mar 16 02:53:55 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat.c,v 1.3 1998/01/31 14:40:15 christos Exp $ */
+/* $NetBSD: compat.c,v 1.4 2005/03/16 02:53:55 xtraeme Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* All rights reserved
@@ -22,7 +22,7 @@
#if 0
static char rcsid[] = "Id: compat.c,v 1.6 1994/01/15 20:43:43 vixie Exp";
#else
-__RCSID("$NetBSD: compat.c,v 1.3 1998/01/31 14:40:15 christos Exp $");
+__RCSID("$NetBSD: compat.c,v 1.4 2005/03/16 02:53:55 xtraeme Exp $");
#endif
#endif
@@ -47,7 +47,7 @@
*/
#ifdef NEED_VFORK
PID_T
-vfork() {
+vfork(void) {
return (fork());
}
#endif
@@ -55,8 +55,7 @@
#ifdef NEED_STRDUP
char *
-strdup(str)
- char *str;
+strdup(char *str)
{
char *temp;
@@ -69,8 +68,7 @@
#ifdef NEED_STRERROR
char *
-strerror(error)
- int error;
+strerror(int error)
{
extern char *sys_errlist[];
extern int sys_nerr;
@@ -88,9 +86,7 @@
#ifdef NEED_STRCASECMP
int
-strcasecmp(left, right)
- char *left;
- char *right;
+strcasecmp(char *left, char *right)
{
while (*left && (MkLower(*left) == MkLower(*right))) {
left++;
@@ -103,7 +99,7 @@
#ifdef NEED_SETSID
int
-setsid()
+setsid(void)
{
int newpgrp;
# if defined(BSD)
@@ -132,7 +128,7 @@
#ifdef NEED_GETDTABLESIZE
int
-getdtablesize() {
+getdtablesize(void) {
#ifdef _SC_OPEN_MAX
return sysconf(_SC_OPEN_MAX);
#else
@@ -183,9 +179,7 @@
/* this code has been reformatted by vixie */
int
-flock(fd, operation)
- int fd;
- int operation;
+flock(int fd, int operation)
{
int i;
@@ -220,9 +214,7 @@
#ifdef NEED_SETENV
int
-setenv(name, value, overwrite)
- char *name, *value;
- int overwrite;
+setenv(char *name, char *value, int overwrite)
{
char *tmp;
diff -r c11fd6580fbe -r 75558700244e usr.sbin/cron/compat.h
--- a/usr.sbin/cron/compat.h Wed Mar 16 02:08:52 2005 +0000
+++ b/usr.sbin/cron/compat.h Wed Mar 16 02:53:55 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat.h,v 1.3 2002/07/14 09:59:23 wiz Exp $ */
+/* $NetBSD: compat.h,v 1.4 2005/03/16 02:53:55 xtraeme Exp $ */
/* Copyright 1993,1994 by Paul Vixie
* All rights reserved
@@ -21,10 +21,6 @@
* Id: compat.h,v 1.8 1994/01/15 20:43:43 vixie Exp
*/
-#ifndef __P
-# define __P(x) x
-#endif
-
#if defined(UNIXPC) || defined(unixpc)
# define UNIXPC 1
# define ATT 1
diff -r c11fd6580fbe -r 75558700244e usr.sbin/cron/cron.c
--- a/usr.sbin/cron/cron.c Wed Mar 16 02:08:52 2005 +0000
+++ b/usr.sbin/cron/cron.c Wed Mar 16 02:53:55 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cron.c,v 1.10 2002/04/25 14:45:05 atatat Exp $ */
+/* $NetBSD: cron.c,v 1.11 2005/03/16 02:53:55 xtraeme Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* All rights reserved
@@ -22,7 +22,7 @@
#if 0
static char rcsid[] = "Id: cron.c,v 2.11 1994/01/15 20:43:43 vixie Exp";
#else
-__RCSID("$NetBSD: cron.c,v 1.10 2002/04/25 14:45:05 atatat Exp $");
+__RCSID("$NetBSD: cron.c,v 1.11 2005/03/16 02:53:55 xtraeme Exp $");
#endif
#endif
@@ -39,31 +39,27 @@
#endif
-static void usage __P((void)),
- run_reboot_jobs __P((cron_db *)),
- cron_tick __P((cron_db *)),
- cron_sync __P((void)),
- cron_sleep __P((void)),
+static void usage(void),
+ run_reboot_jobs(cron_db *),
+ cron_tick(cron_db *),
+ cron_sync(void),
+ cron_sleep(void),
#ifdef USE_SIGCHLD
- sigchld_handler __P((int)),
+ sigchld_handler(int),
#endif
- sighup_handler __P((int)),
- parse_args __P((int c, char *v[]));
+ sighup_handler(int),
+ parse_args(int c, char *v[]);
-int main __P((int, char *[]));
-
static void
-usage() {
+usage(void) {
fprintf(stderr, "usage: %s [-x debugflag[,...]]\n", ProgramName);
exit(ERROR_EXIT);
}
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char **argv)
{
cron_db database;
@@ -133,8 +129,7 @@
static void
-run_reboot_jobs(db)
- cron_db *db;
+run_reboot_jobs(cron_db *db)
{
user *u;
entry *e;
@@ -151,8 +146,7 @@
static void
-cron_tick(db)
- cron_db *db;
+cron_tick(cron_db *db)
{
char *orig_tz, *job_tz;
struct tm *tm;
@@ -226,7 +220,7 @@
* that's something sysadmin's know to expect what with crashing computers..
*/
static void
-cron_sync() {
+cron_sync(void) {
struct tm *tm;
TargetTime = time((time_t*)0);
@@ -236,7 +230,7 @@
static void
-cron_sleep() {
+cron_sleep(void) {
int seconds_to_wait;
do {
@@ -265,8 +259,7 @@
#ifdef USE_SIGCHLD
static void
-sigchld_handler(x)
- int x;
+sigchld_handler(int x)
{
WAIT_T waiter;
PID_T pid;
@@ -297,17 +290,14 @@
static void
-sighup_handler(x)
- int x;
+sighup_handler(int x)
{
log_close();
}
static void
-parse_args(argc, argv)
- int argc;
- char *argv[];
+parse_args(int argc, char **argv)
{
int argch;
diff -r c11fd6580fbe -r 75558700244e usr.sbin/cron/cron.h
--- a/usr.sbin/cron/cron.h Wed Mar 16 02:08:52 2005 +0000
+++ b/usr.sbin/cron/cron.h Wed Mar 16 02:53:55 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cron.h,v 1.3 1998/01/31 14:40:21 christos Exp $ */
+/* $NetBSD: cron.h,v 1.4 2005/03/16 02:53:55 xtraeme Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* All rights reserved
@@ -184,50 +184,50 @@
} cron_db;
-void set_cron_uid __P((void)),
- set_cron_cwd __P((void)),
- load_database __P((cron_db *)),
- open_logfile __P((void)),
- sigpipe_func __P((void)),
- job_add __P((entry *, user *)),
- do_command __P((entry *, user *)),
- link_user __P((cron_db *, user *)),
- unlink_user __P((cron_db *, user *)),
- free_user __P((user *)),
- env_free __P((char **)),
- unget_char __P((int, FILE *)),
- free_entry __P((entry *)),
- acquire_daemonlock __P((int)),
- skip_comments __P((FILE *)),
- log_it __P((char *, int, char *, char *)),
- log_close __P((void));
+void set_cron_uid(void),
+ set_cron_cwd(void),
+ load_database(cron_db *),
+ open_logfile(void),
+ sigpipe_func(void),
+ job_add(entry *, user *),
+ do_command(entry *, user *),
+ link_user(cron_db *, user *),
Home |
Main Index |
Thread Index |
Old Index