[Midnightbsd-cvs] src [11448] trunk/usr.bin/rlogin/rlogin.c: make things static
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat Jul 7 12:41:38 EDT 2018
Revision: 11448
http://svnweb.midnightbsd.org/src/?rev=11448
Author: laffer1
Date: 2018-07-07 12:41:38 -0400 (Sat, 07 Jul 2018)
Log Message:
-----------
make things static
Modified Paths:
--------------
trunk/usr.bin/rlogin/Makefile
trunk/usr.bin/rlogin/rlogin.1
trunk/usr.bin/rlogin/rlogin.c
Property Changed:
----------------
trunk/usr.bin/rlogin/rlogin.1
Modified: trunk/usr.bin/rlogin/Makefile
===================================================================
--- trunk/usr.bin/rlogin/Makefile 2018-07-07 16:38:54 UTC (rev 11447)
+++ trunk/usr.bin/rlogin/Makefile 2018-07-07 16:41:38 UTC (rev 11448)
@@ -1,5 +1,6 @@
+# $MidnightBSD$
# @(#)Makefile 8.1 (Berkeley) 7/19/93
-# $MidnightBSD$
+# $FreeBSD: stable/10/usr.bin/rlogin/Makefile 221123 2011-04-27 17:36:37Z jhb $
PROG= rlogin
Modified: trunk/usr.bin/rlogin/rlogin.1
===================================================================
--- trunk/usr.bin/rlogin/rlogin.1 2018-07-07 16:38:54 UTC (rev 11447)
+++ trunk/usr.bin/rlogin/rlogin.1 2018-07-07 16:41:38 UTC (rev 11448)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
.\" Copyright (c) 1983, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
@@ -26,9 +27,9 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)rlogin.1 8.1 (Berkeley) 6/6/93
-.\" $MidnightBSD$
+.\" $FreeBSD: stable/10/usr.bin/rlogin/rlogin.1 320646 2017-07-04 15:53:54Z allanjude $
.\"
-.Dd September 26, 2003
+.Dd July 3, 2017
.Dt RLOGIN 1
.Os
.Sh NAME
@@ -41,6 +42,15 @@
.Op Fl i Ar localname
.Op Fl l Ar username
.Ar host
+.Sh DEPRECATION NOTICE
+.Nm
+is deprecated and will be removed from future versions of the
+.Fx
+base system.
+If
+.Nm
+is still required, it can be installed from ports or packages
+(net/bsdrcmds).
.Sh DESCRIPTION
The
.Nm
Property changes on: trunk/usr.bin/rlogin/rlogin.1
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.bin/rlogin/rlogin.c
===================================================================
--- trunk/usr.bin/rlogin/rlogin.c 2018-07-07 16:38:54 UTC (rev 11447)
+++ trunk/usr.bin/rlogin/rlogin.c 2018-07-07 16:41:38 UTC (rev 11448)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*
* Copyright (c) 1983, 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -51,7 +52,7 @@
#endif
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/rlogin/rlogin.c 241737 2012-10-19 14:49:42Z ed $");
/*
* rlogin - remote login
@@ -92,35 +93,35 @@
#define SIGUSR1 30
#endif
-int eight, rem;
-struct termios deftty;
+static int eight, rem;
+static struct termios deftty;
-int family = PF_UNSPEC;
+static int family = PF_UNSPEC;
-int noescape;
-u_char escapechar = '~';
+static int noescape;
+static u_char escapechar = '~';
#define get_window_size(fd, wp) ioctl(fd, TIOCGWINSZ, wp)
-struct winsize winsize;
+static struct winsize winsize;
-void catch_child(int);
-void copytochild(int);
-void doit(long) __dead2;
-void done(int) __dead2;
-void echo(char);
-u_int getescape(const char *);
-void lostpeer(int);
-void mode(int);
-void msg(const char *);
-void oob(int);
-int reader(int);
-void sendwindow(void);
-void setsignal(int);
-void sigwinch(int);
-void stop(char);
-void usage(void) __dead2;
-void writer(void);
-void writeroob(int);
+static void catch_child(int);
+static void copytochild(int);
+static _Noreturn void doit(long);
+static _Noreturn void done(int);
+static void echo(char);
+static u_int getescape(const char *);
+static void lostpeer(int);
+static void mode(int);
+static void msg(const char *);
+static void oob(int);
+static int reader(int);
+static void sendwindow(void);
+static void setsignal(int);
+static void sigwinch(int);
+static void stop(char);
+static _Noreturn void usage(void);
+static void writer(void);
+static void writeroob(int);
int
main(int argc, char *argv[])
@@ -142,7 +143,7 @@
one = 1;
host = localname = user = NULL;
- if ((p = rindex(argv[0], '/')))
+ if ((p = strrchr(argv[0], '/')))
++p;
else
p = argv[0];
@@ -269,9 +270,9 @@
/*NOTREACHED*/
}
-int child;
+static int child;
-void
+static void
doit(long omask)
{
@@ -309,7 +310,7 @@
}
/* trap a signal, unless it is being ignored. */
-void
+static void
setsignal(int sig)
{
int omask = sigblock(sigmask(sig));
@@ -319,7 +320,7 @@
(void)sigsetmask(omask);
}
-void
+static void
done(int status)
{
int w, wstatus;
@@ -334,7 +335,7 @@
exit(status);
}
-int dosigwinch;
+static int dosigwinch;
/*
* This is called when the reader process gets the out-of-band (urgent)
@@ -341,7 +342,7 @@
* request to turn on the window-changing protocol.
*/
/* ARGSUSED */
-void
+static void
writeroob(int signo __unused)
{
if (dosigwinch == 0) {
@@ -352,7 +353,7 @@
}
/* ARGSUSED */
-void
+static void
catch_child(int signo __unused)
{
pid_t pid;
@@ -375,7 +376,7 @@
* ~^Z suspend rlogin process.
* ~<delayed-suspend char> suspend rlogin process, but leave reader alone.
*/
-void
+static void
writer(void)
{
int bol, local, n;
@@ -432,7 +433,7 @@
}
}
-void
+static void
echo(char c)
{
char *p;
@@ -454,7 +455,7 @@
(void)write(STDOUT_FILENO, buf, p - buf);
}
-void
+static void
stop(char cmdc)
{
mode(0);
@@ -466,7 +467,7 @@
}
/* ARGSUSED */
-void
+static void
sigwinch(int signo __unused)
{
struct winsize ws;
@@ -481,7 +482,7 @@
/*
* Send the window size to the server via the magic escape
*/
-void
+static void
sendwindow(void)
{
struct winsize ws;
@@ -506,13 +507,13 @@
#define READING 1
#define WRITING 2
-jmp_buf rcvtop;
-int rcvcnt, rcvstate;
-pid_t ppid;
-char rcvbuf[8 * 1024];
+static jmp_buf rcvtop;
+static int rcvcnt, rcvstate;
+static pid_t ppid;
+static char rcvbuf[8 * 1024];
/* ARGSUSED */
-void
+static void
oob(int signo __unused)
{
struct termios tty;
@@ -593,7 +594,7 @@
}
/* reader: read from remote: line -> 1 */
-int
+static int
reader(int omask)
{
int n, remaining;
@@ -636,7 +637,7 @@
}
}
-void
+static void
mode(int f)
{
struct termios tty;
@@ -667,7 +668,7 @@
}
/* ARGSUSED */
-void
+static void
lostpeer(int signo __unused)
{
(void)signal(SIGPIPE, SIG_IGN);
@@ -677,19 +678,19 @@
/* copy SIGURGs to the child process via SIGUSR1. */
/* ARGSUSED */
-void
+static void
copytochild(int signo __unused)
{
(void)kill(child, SIGUSR1);
}
-void
+static void
msg(const char *str)
{
(void)fprintf(stderr, "rlogin: %s\r\n", str);
}
-void
+static void
usage(void)
{
(void)fprintf(stderr,
@@ -698,7 +699,7 @@
exit(1);
}
-u_int
+static u_int
getescape(const char *p)
{
long val;
More information about the Midnightbsd-cvs
mailing list