From 032624d56c174c5c55126582b32e314a6af15522 Mon Sep 17 00:00:00 2001 From: basabi Date: Tue, 13 Sep 2005 07:37:29 -0700 Subject: 6271014 gcc and cmd/cron don't get along 6271953 gcc and cmd/login don't get along 6274736 gcc and ucbcmd/expr don't get along 6274737 gcc and ucbcmd/from don't get along 6274776 gcc and ucbcmd/rusage don't get along 6274779 gcc and ucbcmd/shutdown don't get along --- usr/src/cmd/cron/at.c | 25 +++---- usr/src/cmd/cron/atq.c | 118 +++++++++++++++--------------- usr/src/cmd/cron/atrm.c | 176 ++++++++++++++++++++++++--------------------- usr/src/cmd/cron/cron.c | 12 ++-- usr/src/cmd/cron/crontab.c | 5 +- usr/src/cmd/cron/elm.c | 18 ++--- usr/src/cmd/cron/funcs.c | 19 ++--- 7 files changed, 196 insertions(+), 177 deletions(-) (limited to 'usr/src/cmd/cron') diff --git a/usr/src/cmd/cron/at.c b/usr/src/cmd/cron/at.c index 02e368b3db..4d6158788b 100644 --- a/usr/src/cmd/cron/at.c +++ b/usr/src/cmd/cron/at.c @@ -19,15 +19,15 @@ * * CDDL HEADER END */ -/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ - /* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ +/* All Rights Reserved */ + #pragma ident "%Z%%M% %I% %E% SMI" #include @@ -104,7 +104,7 @@ static int not_this_project(char *); static char *mkjobname(time_t); static time_t parse_time(char *); static time_t gtime(struct tm *); -void atabort(char *); +void atabort(char *)__NORETURN; void yyerror(void); extern int yyparse(void); @@ -146,9 +146,8 @@ extern char *argp; extern int per_errno; static projid_t project; -main(argc, argv) -int argc; -char **argv; +int +main(int argc, char **argv) { FILE *inputfile; int i, fd; @@ -439,6 +438,7 @@ time_t t; t += 1; } atabort("queue full"); + /* NOTREACHED */ } @@ -459,6 +459,7 @@ char *msg; exit(1); } +int yywrap(void) { return (1); @@ -518,7 +519,7 @@ static time_t gtime(tptr) struct tm *tptr; { - register i; + int i; long tv; int dmsize[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; @@ -553,13 +554,13 @@ struct tm *tptr; static void copy(char *jobfile, FILE *inputfile, int when) { - register c; - register FILE *pfp; - register FILE *xfp; + int c; + FILE *pfp; + FILE *xfp; char *shell; char dirbuf[PATH_MAX + 1]; char line[LINE_MAX]; - register char **ep; + char **ep; mode_t um; char *val; extern char **environ; diff --git a/usr/src/cmd/cron/atq.c b/usr/src/cmd/cron/atq.c index 1b3503683d..4cedbb518e 100644 --- a/usr/src/cmd/cron/atq.c +++ b/usr/src/cmd/cron/atq.c @@ -1,3 +1,8 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ @@ -8,12 +13,7 @@ * specifies the terms and conditions for redistribution. */ -/* - * Copyright 1984-1988, 2002-2003 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.6 */ +#pragma ident "%Z%%M% %I% %E% SMI" /* * @@ -56,23 +56,29 @@ struct dirent **queue; /* the queue itself */ #define INVALIDUSER "you are not a valid user (no entry in /etc/passwd)" #define NOTALLOWED "you are not authorized to use at. Sorry." - -main(argc, argv) -int argc; -char **argv; +static void atabortperror(char *msg); +static void atabort(char *msg); +static void aterror(char *msg); +static void atperror(char *msg); +static void usage(void); +static void printjobname(char *file); +static void printdate(char *filename); +static void printrank(int n); +static void printqueue(uid_t *uidlist, int nuids); + +int +main(int argc, char **argv) { - register struct passwd *pp; /* password file entry pointer */ + struct passwd *pp; /* password file entry pointer */ struct passwd pr; - register int i; + int i; int cflag = 0; /* print in order of creation time */ int nflag = 0; /* just print the number of jobs in */ /* queue */ - int usage(); /* print usage info and exit */ extern int creation(); /* sort jobs by date of creation */ extern int execution(); /* sort jobs by date of execution */ int filewanted(); /* should file be included in queue? */ - int printqueue(); /* print the queue */ int countfiles(); /* count the number of files in queue */ /* for a given person */ uid_t *uidlist = NULL; /* array of spec. owner ID(s) requ. */ @@ -202,21 +208,20 @@ char **argv; exit(0); } printqueue(uidlist, argnum); - exit(0); + return (0); } /* * Count the number of jobs in the spooling area owned by a certain person(s). */ -countfiles(uidlist, nuids) -uid_t *uidlist; -int nuids; +int +countfiles(uid_t *uidlist, int nuids) { - register int i, j; /* for loop indices */ + int i, j; /* for loop indices */ int entryfound; /* found file owned by users */ int numfiles = 0; /* number of files owned by a */ /* certain person(s) */ - register uid_t *ptr; /* scratch pointer */ + uid_t *ptr; /* scratch pointer */ struct stat stbuf; /* buffer for file stats */ @@ -248,16 +253,14 @@ int nuids; * Print the queue. If only jobs belonging to a certain person(s) are requested, * only print jobs that belong to that person(s). */ -printqueue(uidlist, nuids) -uid_t *uidlist; -int nuids; +static void +printqueue(uid_t *uidlist, int nuids) { - register int i, j; /* for loop indices */ + int i, j; /* for loop indices */ int rank; /* rank of a job */ int entryfound; /* found file owned by users */ - int printrank(); /* print the rank of a job */ char *getname(); - register uid_t *ptr; /* scratch pointer */ + uid_t *ptr; /* scratch pointer */ struct stat stbuf; /* buffer for file stats */ char curqueue; /* queue of current job */ char lastqueue; /* queue of previous job */ @@ -317,8 +320,7 @@ int nuids; * such account name exists. */ uid_t -getid(name) -char *name; +getid(char *name) { struct passwd *pwdinfo; /* password info structure */ @@ -334,10 +336,9 @@ char *name; * Get the full login name of a person using his/her user id. */ char * -getname(uid) -uid_t uid; +getname(uid_t uid) { - register struct passwd *pwdinfo; /* password info structure */ + struct passwd *pwdinfo; /* password info structure */ if ((pwdinfo = getpwuid(uid)) == 0) @@ -348,8 +349,8 @@ uid_t uid; /* * Print the rank of a job. (I've got to admit it, I stole it from "lpq") */ -static -printrank(n) +static void +printrank(int n) { static char *r[] = { "th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th" @@ -365,12 +366,12 @@ printrank(n) * Print the date that a job is to be executed. This takes some manipulation * of the file name. */ -printdate(filename) -char *filename; +static void +printdate(char *filename) { time_t jobdate; extern time_t num(); - register struct tm *unpackeddate; + struct tm *unpackeddate; char date[18]; /* reformatted execution date */ /* @@ -399,8 +400,8 @@ char *filename; * the three line header that the new version of "at" puts in the spoolfile. * Thus, we just print "???". */ -printjobname(file) -char *file; +static void +printjobname(char *file) { char *ptr; /* scratch pointer */ char jobname[28]; /* the job name */ @@ -453,13 +454,13 @@ char *file; /* * Sort files by queue, time of creation, and sequence. (used by "ascandir") */ -creation(d1, d2) -struct dirent **d1, **d2; +int +creation(struct dirent **d1, struct dirent **d2) { - register char *p1, *p2; - register int i; + char *p1, *p2; + int i; struct stat stbuf1, stbuf2; - register int seq1, seq2; + int seq1, seq2; if ((p1 = strchr((*d1)->d_name, '.')) == NULL) return (0); @@ -490,14 +491,14 @@ struct dirent **d1, **d2; /* * Sort files by queue, time of execution, and sequence. (used by "ascandir") */ -execution(d1, d2) -struct dirent **d1, **d2; +int +execution(struct dirent **d1, struct dirent **d2) { - register char *p1, *p2; - register int i; + char *p1, *p2; + int i; char *name1, *name2; - register time_t time1, time2; - register int seq1, seq2; + time_t time1, time2; + int seq1, seq2; extern time_t num(); name1 = (*d1)->d_name; @@ -529,33 +530,34 @@ struct dirent **d1, **d2; /* * Print usage info and exit. */ -usage() +static void +usage(void) { fprintf(stderr, "usage: atq [-c] [-n] [name ...]\n"); exit(1); } -aterror(msg) - char *msg; +static void +aterror(char *msg) { fprintf(stderr, "atq: %s\n", msg); } -atperror(msg) - char *msg; +static void +atperror(char *msg) { fprintf(stderr, "atq: %s: %s\n", msg, errmsg(errno)); } -atabort(msg) - char *msg; +static void +atabort(char *msg) { aterror(msg); exit(1); } -atabortperror(msg) - char *msg; +static void +atabortperror(char *msg) { atperror(msg); exit(1); diff --git a/usr/src/cmd/cron/atrm.c b/usr/src/cmd/cron/atrm.c index 161b56ece4..54e2ffc124 100644 --- a/usr/src/cmd/cron/atrm.c +++ b/usr/src/cmd/cron/atrm.c @@ -1,3 +1,8 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ @@ -6,12 +11,9 @@ * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. - - * Copyright 1984-2002 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.5 */ +#pragma ident "%Z%%M% %I% %E% SMI" /* * synopsis: atrm [-f] [-i] [-a] [[job #] [user] ...] @@ -30,17 +32,17 @@ #include #include #include +#include #include "cron.h" extern time_t num(); extern char *errmsg(); -extern int errno; extern void audit_at_delete(char *, char *, int); -#define SUPERUSER 0 /* is user super-user? */ -#define CANTCD "can't change directory to the at directory" -#define NOREADDIR "can't read the at directory" +#define SUPERUSER 0 /* is user super-user? */ +#define CANTCD "can't change directory to the at directory" +#define NOREADDIR "can't read the at directory" uid_t user; /* person requesting removal */ int fflag = 0; /* suppress announcements? */ @@ -49,21 +51,25 @@ int iflag = 0; /* run interactively? */ char login[UNAMESIZE]; char login_authchk[UNAMESIZE]; /* used for authorization checks */ -#define INVALIDUSER "you are not a valid user (no entry in /etc/passwd)" -#define NOTALLOWED "you are not authorized to use at. Sorry." +#define INVALIDUSER "you are not a valid user (no entry in /etc/passwd)" +#define NOTALLOWED "you are not authorized to use at. Sorry." #define NAMETOOLONG "login name too long" -main(argc,argv) -int argc; -char **argv; +static void usage(void); +static void atabortperror(char *msg); +static void atabort(char *msg); +static void atperror(char *msg); +static void atperror2(char *msg, char *name); +static void aterror(char *msg); +static void powner(char *file); +int +main(int argc, char **argv) { int i; /* for loop index */ int numjobs; /* # of jobs in spooling area */ - int usage(); /* print usage info and exit */ int allflag = 0; /* remove all jobs belonging to user? */ int jobexists; /* does a requested job exist? */ - extern int strcmp(); /* sort jobs by date of execution */ char *pp; char *getuser(); struct dirent **namelist; /* names of jobs in spooling area */ @@ -74,13 +80,13 @@ char **argv; * If job number, user name, or "-" is not specified, just print * usage info and exit. */ - (void)setlocale(LC_ALL, ""); + (void) setlocale(LC_ALL, ""); if (argc < 2) usage(); --argc; ++argv; - pp = getuser((user=getuid())); + pp = getuser((user = getuid())); if (pp == NULL) atabort(INVALIDUSER); if (strlcpy(login, pp, sizeof (login)) >= sizeof (login)) @@ -97,7 +103,8 @@ char **argv; */ while (argc > 0 && **argv == '-') { *(*argv)++; - while (**argv) switch (*(*argv)++) { + while (**argv) { + switch (*(*argv)++) { case 'a': ++allflag; break; @@ -109,22 +116,23 @@ char **argv; break; default: usage(); + } } ++argv; --argc; } /* - * If all jobs are to be removed and extra command line arguments + * If all jobs are to be removed and extra command line arguments * are given, print usage info and exit. */ - if (allflag && argc) + if (allflag && argc) usage(); /* * If only certain jobs are to be removed and no job #'s or user * names are specified, print usage info and exit. */ - if (!allflag && !argc) + if (!allflag && !argc) usage(); /* @@ -139,7 +147,7 @@ char **argv; * Move to spooling directory and get a list of the files in the * spooling area. */ - numjobs = getjoblist(&namelist,&statlist,strcmp); + numjobs = getjoblist(&namelist, &statlist, strcmp); /* * If all jobs belonging to the user are to be removed, compare * the user's id to the owner of the file. If they match, remove @@ -147,7 +155,7 @@ char **argv; * the id's. After all files are removed, exit (status 0). */ if (allflag) { - for (i = 0; i < numjobs; ++i) { + for (i = 0; i < numjobs; ++i) { if (chkauthattr(CRONADMIN_AUTH, login_authchk) || user == statlist[i]->st_uid) (void) removentry(namelist[i]->d_name, @@ -161,7 +169,7 @@ char **argv; * line argument. A check is done to see if it is a user's name or * a job number (inode #). If it's a user's name, compare the argument * to the files owner. If it's a job number, compare the argument to - * the file name. In either case, if a match occurs, try to + * the file name. In either case, if a match occurs, try to * remove the file. */ @@ -173,7 +181,7 @@ char **argv; if (statlist[i]->st_ino == 0) continue; - /* + /* * if argv is a username, compare his/her uid to * the uid of the owner of the file...... */ @@ -185,7 +193,7 @@ char **argv; * thus compare argv to the file name. */ } else { - if (strcmp(namelist[i]->d_name,*argv)) + if (strcmp(namelist[i]->d_name, *argv)) continue; } ++jobexists; @@ -193,7 +201,8 @@ char **argv; * if the entry is ultimately removed, don't * try to remove it again later. */ - if (removentry(namelist[i]->d_name, statlist[i], user)) { + if (removentry(namelist[i]->d_name, statlist[i], + user)) { statlist[i]->st_ino = 0; } } @@ -202,19 +211,21 @@ char **argv; * If a requested argument doesn't exist, print a message. */ if (!jobexists && !fflag) { - fprintf(stderr, "atrm: %s: no such job number\n", *argv); + fprintf(stderr, "atrm: %s: no such job number\n", + *argv); } ++argv; } - exit(0); + return (0); } /* * Print usage info and exit. */ -usage() +static void +usage(void) { - fprintf(stderr,"usage: atrm [-f] [-i] [-a] [[job #] [user] ...]\n"); + fprintf(stderr, "usage: atrm [-f] [-i] [-a] [[job #] [user] ...]\n"); exit(1); } @@ -224,16 +235,13 @@ usage() * write permission (since all jobs are mode 644). If access is granted, * unlink the file. If the fflag (suppress announcements) is not set, * print the job number that we are removing and the result of the access - * check (either "permission denied" or "removed"). If we are running - * interactively (iflag), prompt the user before we unlink the file. If - * the super-user is removing jobs, inform him/her who owns each file before + * check (either "permission denied" or "removed"). If we are running + * interactively (iflag), prompt the user before we unlink the file. If + * the super-user is removing jobs, inform him/her who owns each file before * it is removed. Return TRUE if file removed, else FALSE. */ int -removentry(filename,statptr,user) -char *filename; -register struct stat *statptr; -uid_t user; +removentry(char *filename, struct stat *statptr, uid_t user) { struct passwd *pwd; char *pp; @@ -241,7 +249,7 @@ uid_t user; int r; if (!fflag) - printf("%s: ",filename); + printf("%s: ", filename); if (user != statptr->st_uid && !chkauthattr(CRONADMIN_AUTH, login_authchk)) { @@ -264,14 +272,14 @@ uid_t user; } if (chkauthattr(CRONADMIN_AUTH, login_authchk)) { - pp = getuser((uid_t) statptr->st_uid); + pp = getuser((uid_t)statptr->st_uid); if (pp == NULL) atabort(INVALIDUSER); if (strlcpy(login, pp, sizeof (login)) >= sizeof (login)) atabort(NAMETOOLONG); } - cron_sendmsg(DELETE,login,filename,AT); + cron_sendmsg(DELETE, login, filename, AT); if ((r = unlink(filename)) < 0) { if (!fflag) { fputs("could not remove\n", stdout); @@ -292,34 +300,32 @@ uid_t user; * Print the owner of the job. This is the owner of the spoolfile. * If we run into trouble getting the name, we'll just print "???". */ -powner(file) -char *file; +static void +powner(char *file) { struct stat statb; char *getname(); - if (stat(file,&statb) < 0) { - printf("%s","???"); - (void) fprintf(stderr,"atrm: Couldn't stat spoolfile %s: %s\n", + if (stat(file, &statb) < 0) { + printf("%s", "???"); + (void) fprintf(stderr, "atrm: Couldn't stat spoolfile %s: %s\n", file, errmsg(errno)); - return(0); + return; } - printf("%s",getname(statb.st_uid)); + printf("%s", getname(statb.st_uid)); } int -getjoblist(namelistp, statlistp,sortfunc) - struct dirent ***namelistp; - struct stat ***statlistp; - int (*sortfunc)(); +getjoblist(struct dirent ***namelistp, struct stat ***statlistp, + int (*sortfunc)()) { - register int numjobs; - register struct dirent **namelist; - register int i; - register struct stat *statptr; /* pointer to file stat structure */ - register struct stat **statlist; + int numjobs; + struct dirent **namelist; + int i; + struct stat *statptr; /* pointer to file stat structure */ + struct stat **statlist; extern int alphasort(); /* sort jobs by date of execution */ extern int filewanted(); /* should a file be listed in queue? */ @@ -329,10 +335,12 @@ getjoblist(namelistp, statlistp,sortfunc) /* * Get a list of the files in the spooling area. */ - if ((numjobs = ascandir(".",namelistp,filewanted,sortfunc)) < 0) + if ((numjobs = ascandir(".", namelistp, filewanted, sortfunc)) < 0) atabortperror(NOREADDIR); - if ((statlist = (struct stat **) malloc(numjobs * sizeof (struct stat ***))) == NULL) + if ((statlist = + (struct stat **)malloc(numjobs * sizeof (struct stat ***))) + == NULL) atabort("Out of memory"); namelist = *namelistp; @@ -341,12 +349,12 @@ getjoblist(namelistp, statlistp,sortfunc) * Build an array of pointers to the file stats for all jobs in * the spooling area. */ - for (i = 0; i < numjobs; ++i) { - statptr = (struct stat *) malloc(sizeof(struct stat)); + for (i = 0; i < numjobs; ++i) { + statptr = (struct stat *)malloc(sizeof (struct stat)); if (statptr == NULL) atabort("Out of memory"); if (stat(namelist[i]->d_name, statptr) < 0) { - atperror("Can't stat", namelist[i]->d_name); + atperror2("Can't stat", namelist[i]->d_name); continue; } statlist[i] = statptr; @@ -361,17 +369,18 @@ getjoblist(namelistp, statlistp,sortfunc) * Get answer to interactive prompts, eating all characters beyond the first * one. If a 'y' is typed, return 1. */ -yes() +int +yes(void) { - register int ch; /* dummy variable */ - register int ch1; /* dummy variable */ + int ch; /* dummy variable */ + int ch1; /* dummy variable */ ch = ch1 = getchar(); while (ch1 != '\n' && ch1 != EOF) ch1 = getchar(); if (isupper(ch)) ch = tolower(ch); - return(ch == 'y'); + return (ch == 'y'); } @@ -379,38 +388,43 @@ yes() * Get the full login name of a person using his/her user id. */ char * -getname(uid) -uid_t uid; +getname(uid_t uid) { - register struct passwd *pwdinfo; /* password info structure */ + struct passwd *pwdinfo; /* password info structure */ if ((pwdinfo = getpwuid(uid)) == 0) - return("???"); - return(pwdinfo->pw_name); + return ("???"); + return (pwdinfo->pw_name); +} + +static void +aterror(char *msg) +{ + fprintf(stderr, "atrm: %s\n", msg); } -aterror(msg) - char *msg; +static void +atperror(char *msg) { - fprintf(stderr,"atrm: %s\n",msg); + fprintf(stderr, "atrm: %s: %s\n", msg, errmsg(errno)); } -atperror(msg) - char *msg; +static void +atperror2(char *msg, char *name) { - fprintf(stderr,"atrm: %s: %s\n", msg, errmsg(errno)); + fprintf(stderr, "atrm: %s %s: %s\n", msg, name, errmsg(errno)); } -atabort(msg) - char *msg; +static void +atabort(char *msg) { aterror(msg); exit(1); } -atabortperror(msg) - char *msg; +static void +atabortperror(char *msg) { atperror(msg); exit(1); diff --git a/usr/src/cmd/cron/cron.c b/usr/src/cmd/cron/cron.c index f29c1917ef..cac3ff108c 100644 --- a/usr/src/cmd/cron/cron.c +++ b/usr/src/cmd/cron/cron.c @@ -316,8 +316,8 @@ static void process_msg(struct message *, time_t); static void reap_child(void); static void miscpid_insert(pid_t); static int miscpid_delete(pid_t); -static int contract_set_template(void); -static int contract_clear_template(void); +static void contract_set_template(void); +static void contract_clear_template(void); static void contract_abandon_latest(pid_t); static void cte_init(void); @@ -3236,8 +3236,8 @@ miscpid_delete(pid_t pid) * Establish contract terms such that all children are in abandoned * process contracts. */ -static int -contract_set_template() +static void +contract_set_template(void) { int fd; @@ -3261,8 +3261,8 @@ contract_set_template() /* * Clear active process contract template. */ -static int -contract_clear_template() +static void +contract_clear_template(void) { int fd; diff --git a/usr/src/cmd/cron/crontab.c b/usr/src/cmd/cron/crontab.c index 2ed88c4c6d..9638fab398 100644 --- a/usr/src/cmd/cron/crontab.c +++ b/usr/src/cmd/cron/crontab.c @@ -101,9 +101,8 @@ static void crabort(char *); static void cerror(char *); static void copycron(FILE *); -main(argc, argv) -int argc; -char **argv; +int +main(int argc, char **argv) { int c, r; int rflag = 0; diff --git a/usr/src/cmd/cron/elm.c b/usr/src/cmd/cron/elm.c index c8b03ea7c9..157b0e00f8 100644 --- a/usr/src/cmd/cron/elm.c +++ b/usr/src/cmd/cron/elm.c @@ -20,16 +20,17 @@ * CDDL HEADER END */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ -/* - * Copyright 2003 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.4 */ +#pragma ident "%Z%%M% %I% %E% SMI" /************************************************************************** *** General-Purpose Event List Manager *** ************************************************************************** @@ -352,7 +353,8 @@ int id,flag; /*************************/ -el_empty() +int +el_empty(void) /*************************/ { if (current == NULL) return(1); @@ -362,7 +364,7 @@ el_empty() /*************************/ void * -el_first() +el_first(void) /*************************/ { struct notice *n,*fn; @@ -455,7 +457,7 @@ el_first() /******************/ void -el_delete() +el_delete(void) /******************/ { /* el_delete frees up all the space associated with the event list */ diff --git a/usr/src/cmd/cron/funcs.c b/usr/src/cmd/cron/funcs.c index 32dc93733b..95641aaaf1 100644 --- a/usr/src/cmd/cron/funcs.c +++ b/usr/src/cmd/cron/funcs.c @@ -19,16 +19,16 @@ * * CDDL HEADER END */ -/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ - /* - * Copyright 1988-2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.4 */ +/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ +/* All Rights Reserved */ + +#pragma ident "%Z%%M% %I% %E% SMI" #include #include @@ -63,6 +63,7 @@ num(char **ptr) static int dom[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; +int days_btwn(int m1, int d1, int y1, int m2, int d2, int y2) { /* @@ -177,7 +178,7 @@ int filewanted(struct dirent *direntry) { char *p; - register char c; + char c; p = direntry->d_name; (void) num(&p); @@ -215,9 +216,9 @@ ascandir(dirname, namelist, select, dcomp) int (*select)(); int (*dcomp)(); { - register struct dirent *d, *p, **names; - register int nitems; - register char *cp1, *cp2; + struct dirent *d, *p, **names; + int nitems; + char *cp1, *cp2; struct stat stb; long arraysz; DIR *dirp; -- cgit v1.2.3