diff options
author | markm <markm@FreeBSD.org> | 2001-12-02 12:26:18 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2001-12-02 12:26:18 +0000 |
commit | 1713f5e655d170628c97191eacac5663fb39d978 (patch) | |
tree | ff842953cae89f6bfa561e2572decf2ed59a08f7 /usr.bin/at | |
parent | df573903aa0a7f705699fc186618360f65d63c9e (diff) | |
download | FreeBSD-src-1713f5e655d170628c97191eacac5663fb39d978.zip FreeBSD-src-1713f5e655d170628c97191eacac5663fb39d978.tar.gz |
WARNS=2 fixup.
Diffstat (limited to 'usr.bin/at')
-rw-r--r-- | usr.bin/at/Makefile | 2 | ||||
-rw-r--r-- | usr.bin/at/at.c | 14 | ||||
-rw-r--r-- | usr.bin/at/panic.c | 4 | ||||
-rw-r--r-- | usr.bin/at/panic.h | 6 | ||||
-rw-r--r-- | usr.bin/at/parsetime.c | 7 | ||||
-rw-r--r-- | usr.bin/at/perm.c | 5 | ||||
-rw-r--r-- | usr.bin/at/perm.h | 4 |
7 files changed, 24 insertions, 18 deletions
diff --git a/usr.bin/at/Makefile b/usr.bin/at/Makefile index f69aee3..1b44a4c 100644 --- a/usr.bin/at/Makefile +++ b/usr.bin/at/Makefile @@ -3,8 +3,8 @@ .include "${.CURDIR}/Makefile.inc" PROG= at -CFLAGS+=-Wall SRCS= at.c panic.c parsetime.c perm.c +WARNS?= 2 LINKS= ${BINDIR}/at ${BINDIR}/atq \ ${BINDIR}/at ${BINDIR}/atrm \ ${BINDIR}/at ${BINDIR}/batch diff --git a/usr.bin/at/at.c b/usr.bin/at/at.c index 391dd0e..af671da 100644 --- a/usr.bin/at/at.c +++ b/usr.bin/at/at.c @@ -98,7 +98,7 @@ enum { ATQ, ATRM, AT, BATCH, CAT }; /* what program we want to run */ /* File scope variables */ -char *no_export[] = +const char *no_export[] = { "TERM", "TERMCAP", "DISPLAY", "_" } ; @@ -122,10 +122,11 @@ static void alarmc(int signo); static char *cwdname(void); static void writefile(time_t runtimer, char queue); static void list_jobs(void); +static long nextjob(void); /* Signal catching functions */ -static void sigc(int signo) +static void sigc(int signo __unused) { /* If the user presses ^C, remove the spool file and exit */ @@ -139,7 +140,7 @@ static void sigc(int signo) _exit(EXIT_FAILURE); } -static void alarmc(int signo) +static void alarmc(int signo __unused) { char buf[1024]; @@ -360,7 +361,7 @@ writefile(time_t runtimer, char queue) eqp = *atenv; else { - int i; + size_t i; for (i=0; i<sizeof(no_export)/sizeof(no_export[0]); i++) { export = export @@ -496,7 +497,7 @@ list_jobs() runtimer = 60*(time_t) ctm; runtime = *localtime(&runtimer); - strftime(timestr, TIMESIZE, "%X %x", &runtime); + strftime(timestr, TIMESIZE, "%+", &runtime); if (first) { printf("Date\t\t\tOwner\tQueue\tJob#\n"); first=0; @@ -601,9 +602,8 @@ main(int argc, char **argv) char queue_set = 0; char *pgm; - enum { ATQ, ATRM, AT, BATCH, CAT }; /* what program we want to run */ int program = AT; /* our default program */ - char *options = "q:f:mvldbVc"; /* default options for at */ + const char *options = "q:f:mvldbVc";/* default options for at */ int disp_version = 0; time_t timer; diff --git a/usr.bin/at/panic.c b/usr.bin/at/panic.c index cf6d041..302ae58 100644 --- a/usr.bin/at/panic.c +++ b/usr.bin/at/panic.c @@ -47,7 +47,7 @@ static const char rcsid[] = /* Global functions */ void -panic(char *a) +panic(const char *a) { /* Something fatal has happened, print error message and exit. */ @@ -61,7 +61,7 @@ panic(char *a) } void -perr(char *a) +perr(const char *a) { /* Some operating system error; print error message and exit. */ diff --git a/usr.bin/at/panic.h b/usr.bin/at/panic.h index a809b8a..ff6c110 100644 --- a/usr.bin/at/panic.h +++ b/usr.bin/at/panic.h @@ -21,6 +21,8 @@ * THEORY OF LIABILITY, WETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ */ #ifdef __FreeBSD__ @@ -31,12 +33,12 @@ void #ifdef __GNUC__ __NORETURN #endif -panic(char *a); +panic(const char *a); void #ifdef __GNUC__ __NORETURN #endif -perr(char *a); +perr(const char *a); void #ifdef __GNUC__ __NORETURN diff --git a/usr.bin/at/parsetime.c b/usr.bin/at/parsetime.c index d4797e7..dc0d180 100644 --- a/usr.bin/at/parsetime.c +++ b/usr.bin/at/parsetime.c @@ -57,6 +57,7 @@ static const char rcsid[] = #include "at.h" #include "panic.h" +#include "parsetime.h" /* Structures and unions */ @@ -74,7 +75,7 @@ enum { /* symbols */ /* parse translation table - table driven parsers can be your FRIEND! */ struct { - char *name; /* token name */ + const char *name; /* token name */ int value; /* token id */ int plural; /* is this plural? */ } Specials[] = { @@ -159,7 +160,7 @@ static int sc_tokplur; /* scanner - is token plural? */ static int parse_token(char *arg) { - int i; + size_t i; for (i=0; i<(sizeof Specials/sizeof Specials[0]); i++) if (strcasecmp(Specials[i].name, arg) == 0) { @@ -193,7 +194,7 @@ init_scanner(int argc, char **argv) * token() fetches a token from the input stream */ static int -token() +token(void) { int idx; diff --git a/usr.bin/at/perm.c b/usr.bin/at/perm.c index 6380f46..1e9ec9c 100644 --- a/usr.bin/at/perm.c +++ b/usr.bin/at/perm.c @@ -42,8 +42,9 @@ static const char rcsid[] = /* Local headers */ -#include "privs.h" #include "at.h" +#include "perm.h" +#include "privs.h" /* Macros */ @@ -81,7 +82,7 @@ static int check_for_user(FILE *fp,const char *name) return found; } /* Global functions */ -int check_permission() +int check_permission(void) { FILE *fp; uid_t uid = geteuid(); diff --git a/usr.bin/at/perm.h b/usr.bin/at/perm.h index 0a12a90..b55b5fb 100644 --- a/usr.bin/at/perm.h +++ b/usr.bin/at/perm.h @@ -21,6 +21,8 @@ * THEORY OF LIABILITY, WETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ */ -int check_permission(); +int check_permission(void); |