From c6dc21807ec81299fd28bdfc0038d9c348d5a057 Mon Sep 17 00:00:00 2001 From: markm Date: Tue, 11 Dec 2001 22:22:15 +0000 Subject: WARNS=2 fix, use __FBSDID(). Not added to Makefile as WARNS=2 will be made default. --- usr.bin/wall/ttymsg.c | 10 +++++----- usr.bin/wall/wall.c | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 14 deletions(-) (limited to 'usr.bin/wall') diff --git a/usr.bin/wall/ttymsg.c b/usr.bin/wall/ttymsg.c index c03454e..01db118 100644 --- a/usr.bin/wall/ttymsg.c +++ b/usr.bin/wall/ttymsg.c @@ -31,13 +31,13 @@ * SUCH DAMAGE. */ +#include + +__FBSDID("$FreeBSD$"); + #ifndef lint -#if 0 -static char sccsid[] = "@(#)ttymsg.c 8.2 (Berkeley) 11/16/93"; +static const char sccsid[] = "@(#)ttymsg.c 8.2 (Berkeley) 11/16/93"; #endif -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ #include #include diff --git a/usr.bin/wall/wall.c b/usr.bin/wall/wall.c index 3e25676..b34f648 100644 --- a/usr.bin/wall/wall.c +++ b/usr.bin/wall/wall.c @@ -31,19 +31,19 @@ * SUCH DAMAGE. */ +#include + +__FBSDID("$FreeBSD$"); + #ifndef lint static const char copyright[] = "@(#) Copyright (c) 1988, 1990, 1993\n\ The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ +#endif #ifndef lint -#if 0 -static char sccsid[] = "@(#)wall.c 8.2 (Berkeley) 11/16/93"; +static const char sccsid[] = "@(#)wall.c 8.2 (Berkeley) 11/16/93"; #endif -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ /* * This program is not related to David Wall, whose Stanford Ph.D. thesis @@ -150,7 +150,7 @@ main(int argc, char *argv[]) if (!pw) continue; for (g = grouplist; g && ingroup == 0; g = g->next) { - if (g->gid == -1) + if (g->gid == (gid_t)-1) continue; if (g->gid == pw->pw_gid) ingroup = 1; @@ -192,7 +192,8 @@ makemsg(char *fname) time_t now; FILE *fp; int fd; - char *p, *tty, hostname[MAXHOSTNAMELEN], lbuf[256], tmpname[64]; + char *p, hostname[MAXHOSTNAMELEN], lbuf[256], tmpname[64]; + const char *tty; const char *whom; gid_t egid; @@ -290,7 +291,7 @@ makemsg(char *fname) mbufsize = sbuf.st_size; if (!(mbuf = malloc((u_int)mbufsize))) err(1, "out of memory"); - if (fread(mbuf, sizeof(*mbuf), mbufsize, fp) != mbufsize) + if ((int)fread(mbuf, sizeof(*mbuf), mbufsize, fp) != mbufsize) err(1, "can't read temporary file"); (void)close(fd); } -- cgit v1.1