From e7c71595422e1bff71f8a128b7bbefc59150c5ae Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Sun, 28 Apr 2002 11:16:43 +0000 Subject: [PATCH] Easy warns fixes; use const, mark unused function parameters. Remove unused includes. --- usr.bin/rlogin/rlogin.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/usr.bin/rlogin/rlogin.c b/usr.bin/rlogin/rlogin.c index 7e8d2d0ea4d0..f5c312b2620a 100644 --- a/usr.bin/rlogin/rlogin.c +++ b/usr.bin/rlogin/rlogin.c @@ -39,13 +39,14 @@ static const char copyright[] = #ifndef lint static const char sccsid[] = "@(#)rlogin.c 8.1 (Berkeley) 6/6/93"; -static const char rcsid[] = - "$FreeBSD$"; #endif /* not lint */ /* * rlogin - remote login */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -70,7 +71,6 @@ static const char rcsid[] = #include #include #include -#include #ifdef KERBEROS #include @@ -100,7 +100,7 @@ int family = PF_UNSPEC; int noescape; u_char escapechar = '~'; -char *speeds[] = { +const char *speeds[] = { "0", "50", "75", "110", "134", "150", "200", "300", "600", "1200", "1800", "2400", "4800", "9600", "19200", "38400", "57600", "115200" #define MAX_SPEED_LENGTH (sizeof("115200") - 1) @@ -117,7 +117,7 @@ void echo(char); u_int getescape(char *); void lostpeer(int); void mode(int); -void msg(char *); +void msg(const char *); void oob(int); int reader(int); void sendwindow(void); @@ -449,7 +449,7 @@ int dosigwinch; * request to turn on the window-changing protocol. */ void -writeroob(int signo) +writeroob(int signo __unused) { if (dosigwinch == 0) { sendwindow(); @@ -459,7 +459,7 @@ writeroob(int signo) } void -catch_child(int signo) +catch_child(int signo __unused) { union wait status; int pid; @@ -588,8 +588,7 @@ stop(char cmdc) } void -sigwinch(signo) - int signo; +sigwinch(int signo __unused) { struct winsize ws; @@ -641,7 +640,7 @@ int ppid, rcvcnt, rcvstate; char rcvbuf[8 * 1024]; void -oob(int signo) +oob(int signo __unused) { struct sgttyb sb; int atmark, n, out, rcvd; @@ -657,7 +656,7 @@ oob(int signo) * to send it yet if we are blocked for output and * our input buffer is full. */ - if (rcvcnt < sizeof(rcvbuf)) { + if (rcvcnt < (int)sizeof(rcvbuf)) { n = read(rem, rcvbuf + rcvcnt, sizeof(rcvbuf) - rcvcnt); if (n <= 0) @@ -826,7 +825,7 @@ mode(int f) } void -lostpeer(int signo) +lostpeer(int signo __unused) { (void)signal(SIGPIPE, SIG_IGN); msg("\007connection closed."); @@ -835,13 +834,13 @@ lostpeer(int signo) /* copy SIGURGs to the child process via SIGUSR1. */ void -copytochild(int signo) +copytochild(int signo __unused) { (void)kill(child, SIGUSR1); } void -msg(char *str) +msg(const char *str) { (void)fprintf(stderr, "rlogin: %s\r\n", str); }