diff options
author | markm <markm@FreeBSD.org> | 2002-04-28 11:16:43 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2002-04-28 11:16:43 +0000 |
commit | 2720780e6c0e17eb1886155535b26a8443345611 (patch) | |
tree | 17cf7439a2865696fcbbb209f18b7b8b511afa9c /usr.bin | |
parent | 68f25a87ca5ade548bd6e8a7100e58abdc9218dd (diff) | |
download | FreeBSD-src-2720780e6c0e17eb1886155535b26a8443345611.zip FreeBSD-src-2720780e6c0e17eb1886155535b26a8443345611.tar.gz |
Easy warns fixes; use const, mark unused function parameters. Remove
unused includes.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/rlogin/rlogin.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/usr.bin/rlogin/rlogin.c b/usr.bin/rlogin/rlogin.c index 7e8d2d0..f5c312b 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 <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + #include <sys/param.h> #include <sys/socket.h> #include <sys/time.h> @@ -70,7 +71,6 @@ static const char rcsid[] = #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <err.h> #ifdef KERBEROS #include <openssl/des.h> @@ -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); } |