summaryrefslogtreecommitdiff
path: root/usr.bin/write/write.c
diff options
context:
space:
mode:
authorjoerg <joerg@NetBSD.org>2011-09-06 18:46:35 +0000
committerjoerg <joerg@NetBSD.org>2011-09-06 18:46:35 +0000
commitd6e4ceaf7d417652fefec7eba9cda65002720b83 (patch)
treec4158a197b46678e7a7df49c6facc8a54cff21c5 /usr.bin/write/write.c
parent9c153ba6f8c841ca6ccc4627a1f072d275419ac2 (diff)
static + __dead
Diffstat (limited to 'usr.bin/write/write.c')
-rw-r--r--usr.bin/write/write.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/usr.bin/write/write.c b/usr.bin/write/write.c
index 7059b4c5460..945e92fe52c 100644
--- a/usr.bin/write/write.c
+++ b/usr.bin/write/write.c
@@ -1,4 +1,4 @@
-/* $NetBSD: write.c,v 1.26 2011/08/31 16:24:58 plunky Exp $ */
+/* $NetBSD: write.c,v 1.27 2011/09/06 18:46:35 joerg Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\
#if 0
static char sccsid[] = "@(#)write.c 8.2 (Berkeley) 4/27/95";
#else
-__RCSID("$NetBSD: write.c,v 1.26 2011/08/31 16:24:58 plunky Exp $");
+__RCSID("$NetBSD: write.c,v 1.27 2011/09/06 18:46:35 joerg Exp $");
#endif
#endif /* not lint */
@@ -65,13 +65,11 @@ __RCSID("$NetBSD: write.c,v 1.26 2011/08/31 16:24:58 plunky Exp $");
#include "utmpentry.h"
#include "term_chk.h"
-void done(int);
-void do_write(int, const char *, const uid_t);
-void wr_fputs(char *);
-int search_utmp(char *, char *, uid_t, gid_t);
-int utmp_chk(const char *, const char *);
-int main(int, char **);
-
+__dead static void done(int);
+static void do_write(int, const char *, const uid_t);
+static void wr_fputs(char *);
+static int search_utmp(char *, char *, uid_t, gid_t);
+static int utmp_chk(const char *, const char *);
int
main(int argc, char **argv)
@@ -127,7 +125,7 @@ main(int argc, char **argv)
* utmp_chk - checks that the given user is actually logged in on
* the given tty
*/
-int
+static int
utmp_chk(const char *user, const char *tty)
{
struct utmpentry *ep;
@@ -151,7 +149,7 @@ utmp_chk(const char *user, const char *tty)
* Special case for writing to yourself - ignore the terminal you're
* writing from, unless that's the only terminal with messages enabled.
*/
-int
+static int
search_utmp(char *user, char *mytty, uid_t myuid, gid_t saved_egid)
{
char tty[MAXPATHLEN];
@@ -214,7 +212,7 @@ search_utmp(char *user, char *mytty, uid_t myuid, gid_t saved_egid)
/*
* do_write - actually make the connection
*/
-void
+static void
do_write(int ttyfd, const char *mytty, const uid_t myuid)
{
const char *login;
@@ -255,7 +253,7 @@ do_write(int ttyfd, const char *mytty, const uid_t myuid)
/*
* done - cleanup and exit
*/
-void
+static void
done(int signo)
{
@@ -270,7 +268,7 @@ done(int signo)
* wr_fputs - like fputs(), but makes control characters visible and
* turns \n into \r\n
*/
-void
+static void
wr_fputs(char *s)
{
unsigned char c;