mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-18 10:35:55 +00:00
Easy warns fixes; use const, mark unused function parameters. Remove
unused includes.
This commit is contained in:
parent
c0bef837ba
commit
e7c7159542
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=95621
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user