Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/rlogin static + __dead
details: https://anonhg.NetBSD.org/src/rev/5cfd519f14c4
branches: trunk
changeset: 769325:5cfd519f14c4
user: joerg <joerg%NetBSD.org@localhost>
date: Tue Sep 06 18:28:35 2011 +0000
description:
static + __dead
diffstat:
usr.bin/rlogin/rlogin.c | 107 +++++++++++++++++++++++------------------------
1 files changed, 52 insertions(+), 55 deletions(-)
diffs (278 lines):
diff -r 06ce8cfe9ef4 -r 5cfd519f14c4 usr.bin/rlogin/rlogin.c
--- a/usr.bin/rlogin/rlogin.c Tue Sep 06 18:28:18 2011 +0000
+++ b/usr.bin/rlogin/rlogin.c Tue Sep 06 18:28:35 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rlogin.c,v 1.40 2009/04/13 04:37:53 lukem Exp $ */
+/* $NetBSD: rlogin.c,v 1.41 2011/09/06 18:28:35 joerg Exp $ */
/*
* Copyright (c) 1983, 1990, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)rlogin.c 8.4 (Berkeley) 4/29/95";
#else
-__RCSID("$NetBSD: rlogin.c,v 1.40 2009/04/13 04:37:53 lukem Exp $");
+__RCSID("$NetBSD: rlogin.c,v 1.41 2011/09/06 18:28:35 joerg Exp $");
#endif
#endif /* not lint */
@@ -87,11 +87,11 @@
#define CCEQ(val, c) (c == val ? val != _POSIX_VDISABLE : 0)
#endif
-int eight, rem;
-struct termios deftty;
+static int eight, rem;
+static struct termios deftty;
-int noescape;
-u_char escapechar = '~';
+static int noescape;
+static u_char escapechar = '~';
#ifdef OLDSUN
struct winsize {
@@ -101,30 +101,29 @@
#else
#define get_window_size(fd, wp) ioctl(fd, TIOCGWINSZ, wp)
#endif
-struct winsize winsize;
+static struct winsize winsize;
-void catch_child(int);
-void copytochild(int);
-void doit(sigset_t *);
-void done(int);
-void echo(int);
-u_int getescape(char *);
-void lostpeer(int);
-int main(int, char **);
-void mode(int);
-void msg(const char *);
-void oob(int);
-int reader(sigset_t *);
-void sendwindow(void);
-void setsignal(int);
-void sigwinch(int);
-void stop(int);
-void usage(void);
-void writer(void);
-void writeroob(int);
+static void catch_child(int);
+static void copytochild(int);
+__dead static void doit(sigset_t *);
+__dead static void done(int);
+static void echo(int);
+static u_int getescape(char *);
+__dead static void lostpeer(int);
+static void mode(int);
+static void msg(const char *);
+static void oob(int);
+static int reader(sigset_t *);
+static void sendwindow(void);
+static void setsignal(int);
+static void sigwinch(int);
+static void stop(int);
+__dead static void usage(void);
+static void writer(void);
+static void writeroob(int);
#ifdef OLDSUN
-int get_window_size(int, struct winsize *);
+static int get_window_size(int, struct winsize *);
#endif
int
@@ -294,9 +293,9 @@
return (0);
}
-pid_t child;
+static pid_t child;
-void
+static void
doit(sigset_t *smask)
{
struct sigaction sa;
@@ -340,7 +339,7 @@
}
/* trap a signal, unless it is being ignored. */
-void
+static void
setsignal(int sig)
{
struct sigaction sa;
@@ -360,7 +359,7 @@
(void)sigprocmask(SIG_SETMASK, &sigs, (sigset_t *) 0);
}
-void
+static void
done(int status)
{
pid_t w;
@@ -381,13 +380,13 @@
exit(status);
}
-int dosigwinch;
+static int dosigwinch;
/*
* This is called when the reader process gets the out-of-band (urgent)
* request to turn on the window-changing protocol.
*/
-void
+static void
writeroob(int signo)
{
struct sigaction sa;
@@ -402,7 +401,7 @@
dosigwinch = 1;
}
-void
+static void
catch_child(int signo)
{
int status;
@@ -425,7 +424,7 @@
* ~^Z suspend rlogin process.
* ~<delayed-suspend char> suspend rlogin process, but leave reader alone.
*/
-void
+static void
writer(void)
{
int bol, local, n;
@@ -489,7 +488,7 @@
}
}
-void
+static void
echo(int i)
{
char c = (char)i;
@@ -512,7 +511,7 @@
(void)write(STDOUT_FILENO, buf, p - buf);
}
-void
+static void
stop(int all)
{
struct sigaction sa;
@@ -529,7 +528,7 @@
sigwinch(0); /* check for size changes */
}
-void
+static void
sigwinch(int signo)
{
struct winsize ws;
@@ -544,7 +543,7 @@
/*
* Send the window size to the server via the magic escape
*/
-void
+static void
sendwindow(void)
{
struct winsize *wp;
@@ -569,12 +568,12 @@
#define READING 1
#define WRITING 2
-jmp_buf rcvtop;
-pid_t ppid;
-int rcvcnt, rcvstate;
-char rcvbuf[8 * 1024];
+static jmp_buf rcvtop;
+static pid_t ppid;
+static int rcvcnt, rcvstate;
+static char rcvbuf[8 * 1024];
-void
+static void
oob(int signo)
{
struct termios tty;
@@ -655,7 +654,7 @@
}
/* reader: read from remote: line -> 1 */
-int
+static int
reader(sigset_t *smask)
{
pid_t pid;
@@ -703,7 +702,7 @@
}
}
-void
+static void
mode(int f)
{
struct termios tty;
@@ -734,7 +733,7 @@
}
}
-void
+static void
lostpeer(int signo)
{
struct sigaction sa;
@@ -746,14 +745,14 @@
}
/* copy SIGURGs to the child process. */
-void
+static void
copytochild(int signo)
{
(void)kill(child, SIGURG);
}
-void
+static void
msg(const char *str)
{
@@ -761,7 +760,7 @@
}
-void
+static void
usage(void)
{
(void)fprintf(stderr,
@@ -775,10 +774,8 @@
* Suns and others. Suns have only a `ttysize', so we convert it to a winsize.
*/
#ifdef OLDSUN
-int
-get_window_size(fd, wp)
- int fd;
- struct winsize *wp;
+static int
+get_window_size(int fd, struct winsize *wp)
{
struct ttysize ts;
int error;
@@ -793,7 +790,7 @@
}
#endif
-u_int
+static u_int
getescape(char *p)
{
long val;
Home |
Main Index |
Thread Index |
Old Index