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
|
#ifndef lint
|
||||||
static const char sccsid[] = "@(#)rlogin.c 8.1 (Berkeley) 6/6/93";
|
static const char sccsid[] = "@(#)rlogin.c 8.1 (Berkeley) 6/6/93";
|
||||||
static const char rcsid[] =
|
|
||||||
"$FreeBSD$";
|
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* rlogin - remote login
|
* rlogin - remote login
|
||||||
*/
|
*/
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
@ -70,7 +71,6 @@ static const char rcsid[] =
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <err.h>
|
|
||||||
|
|
||||||
#ifdef KERBEROS
|
#ifdef KERBEROS
|
||||||
#include <openssl/des.h>
|
#include <openssl/des.h>
|
||||||
@ -100,7 +100,7 @@ int family = PF_UNSPEC;
|
|||||||
int noescape;
|
int noescape;
|
||||||
u_char escapechar = '~';
|
u_char escapechar = '~';
|
||||||
|
|
||||||
char *speeds[] = {
|
const char *speeds[] = {
|
||||||
"0", "50", "75", "110", "134", "150", "200", "300", "600", "1200",
|
"0", "50", "75", "110", "134", "150", "200", "300", "600", "1200",
|
||||||
"1800", "2400", "4800", "9600", "19200", "38400", "57600", "115200"
|
"1800", "2400", "4800", "9600", "19200", "38400", "57600", "115200"
|
||||||
#define MAX_SPEED_LENGTH (sizeof("115200") - 1)
|
#define MAX_SPEED_LENGTH (sizeof("115200") - 1)
|
||||||
@ -117,7 +117,7 @@ void echo(char);
|
|||||||
u_int getescape(char *);
|
u_int getescape(char *);
|
||||||
void lostpeer(int);
|
void lostpeer(int);
|
||||||
void mode(int);
|
void mode(int);
|
||||||
void msg(char *);
|
void msg(const char *);
|
||||||
void oob(int);
|
void oob(int);
|
||||||
int reader(int);
|
int reader(int);
|
||||||
void sendwindow(void);
|
void sendwindow(void);
|
||||||
@ -449,7 +449,7 @@ int dosigwinch;
|
|||||||
* request to turn on the window-changing protocol.
|
* request to turn on the window-changing protocol.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
writeroob(int signo)
|
writeroob(int signo __unused)
|
||||||
{
|
{
|
||||||
if (dosigwinch == 0) {
|
if (dosigwinch == 0) {
|
||||||
sendwindow();
|
sendwindow();
|
||||||
@ -459,7 +459,7 @@ writeroob(int signo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
catch_child(int signo)
|
catch_child(int signo __unused)
|
||||||
{
|
{
|
||||||
union wait status;
|
union wait status;
|
||||||
int pid;
|
int pid;
|
||||||
@ -588,8 +588,7 @@ stop(char cmdc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
sigwinch(signo)
|
sigwinch(int signo __unused)
|
||||||
int signo;
|
|
||||||
{
|
{
|
||||||
struct winsize ws;
|
struct winsize ws;
|
||||||
|
|
||||||
@ -641,7 +640,7 @@ int ppid, rcvcnt, rcvstate;
|
|||||||
char rcvbuf[8 * 1024];
|
char rcvbuf[8 * 1024];
|
||||||
|
|
||||||
void
|
void
|
||||||
oob(int signo)
|
oob(int signo __unused)
|
||||||
{
|
{
|
||||||
struct sgttyb sb;
|
struct sgttyb sb;
|
||||||
int atmark, n, out, rcvd;
|
int atmark, n, out, rcvd;
|
||||||
@ -657,7 +656,7 @@ oob(int signo)
|
|||||||
* to send it yet if we are blocked for output and
|
* to send it yet if we are blocked for output and
|
||||||
* our input buffer is full.
|
* our input buffer is full.
|
||||||
*/
|
*/
|
||||||
if (rcvcnt < sizeof(rcvbuf)) {
|
if (rcvcnt < (int)sizeof(rcvbuf)) {
|
||||||
n = read(rem, rcvbuf + rcvcnt,
|
n = read(rem, rcvbuf + rcvcnt,
|
||||||
sizeof(rcvbuf) - rcvcnt);
|
sizeof(rcvbuf) - rcvcnt);
|
||||||
if (n <= 0)
|
if (n <= 0)
|
||||||
@ -826,7 +825,7 @@ mode(int f)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
lostpeer(int signo)
|
lostpeer(int signo __unused)
|
||||||
{
|
{
|
||||||
(void)signal(SIGPIPE, SIG_IGN);
|
(void)signal(SIGPIPE, SIG_IGN);
|
||||||
msg("\007connection closed.");
|
msg("\007connection closed.");
|
||||||
@ -835,13 +834,13 @@ lostpeer(int signo)
|
|||||||
|
|
||||||
/* copy SIGURGs to the child process via SIGUSR1. */
|
/* copy SIGURGs to the child process via SIGUSR1. */
|
||||||
void
|
void
|
||||||
copytochild(int signo)
|
copytochild(int signo __unused)
|
||||||
{
|
{
|
||||||
(void)kill(child, SIGUSR1);
|
(void)kill(child, SIGUSR1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
msg(char *str)
|
msg(const char *str)
|
||||||
{
|
{
|
||||||
(void)fprintf(stderr, "rlogin: %s\r\n", str);
|
(void)fprintf(stderr, "rlogin: %s\r\n", str);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user