static + __dead

This commit is contained in:
joerg 2011-09-06 18:29:35 +00:00
parent cfac3cac2b
commit 4d72fc9046
2 changed files with 48 additions and 50 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: rusers.c,v 1.24 2011/08/30 17:06:21 plunky Exp $ */ /* $NetBSD: rusers.c,v 1.25 2011/09/06 18:29:35 joerg Exp $ */
/*- /*-
* Copyright (c) 1993 John Brezak * Copyright (c) 1993 John Brezak
@ -30,7 +30,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: rusers.c,v 1.24 2011/08/30 17:06:21 plunky Exp $"); __RCSID("$NetBSD: rusers.c,v 1.25 2011/09/06 18:29:35 joerg Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/types.h> #include <sys/types.h>
@ -58,19 +58,18 @@ __RCSID("$NetBSD: rusers.c,v 1.24 2011/08/30 17:06:21 plunky Exp $");
#define MAX_INT 0x7fffffff #define MAX_INT 0x7fffffff
struct timeval timeout = { 25, 0 }; static struct timeval timeout = { 25, 0 };
int longopt; static int longopt;
int allopt; static int allopt;
void allhosts(void); static void allhosts(void);
int main(int, char *[]); static void onehost(char *);
void onehost(char *); static void remember_host(struct sockaddr *);
void remember_host(struct sockaddr *); static int rusers_reply(char *, struct netbuf *, struct netconfig *);
int rusers_reply(char *, struct netbuf *, struct netconfig *); static int search_host(struct sockaddr *);
int search_host(struct sockaddr *); __dead static void usage(void);
void usage(void);
struct host_list { static struct host_list {
struct host_list *next; struct host_list *next;
int family; int family;
union { union {
@ -82,7 +81,7 @@ struct host_list {
#define addr6 addr._addr6 #define addr6 addr._addr6
#define addr4 addr._addr4 #define addr4 addr._addr4
int static int
search_host(struct sockaddr *sa) search_host(struct sockaddr *sa)
{ {
struct host_list *hp; struct host_list *hp;
@ -111,7 +110,7 @@ search_host(struct sockaddr *sa)
return(0); return(0);
} }
void static void
remember_host(struct sockaddr *sa) remember_host(struct sockaddr *sa)
{ {
struct host_list *hp; struct host_list *hp;
@ -138,7 +137,7 @@ remember_host(struct sockaddr *sa)
hosts = hp; hosts = hp;
} }
int static int
rusers_reply(char *replyp, struct netbuf *raddrp, struct netconfig *nconf) rusers_reply(char *replyp, struct netbuf *raddrp, struct netconfig *nconf)
{ {
char host[NI_MAXHOST]; char host[NI_MAXHOST];
@ -223,7 +222,7 @@ rusers_reply(char *replyp, struct netbuf *raddrp, struct netconfig *nconf)
return(0); return(0);
} }
void static void
onehost(char *host) onehost(char *host)
{ {
struct utmpidlearr up; struct utmpidlearr up;
@ -254,7 +253,7 @@ onehost(char *host)
freeaddrinfo(ai); freeaddrinfo(ai);
} }
void static void
allhosts(void) allhosts(void)
{ {
struct utmpidlearr up; struct utmpidlearr up;
@ -269,7 +268,7 @@ allhosts(void)
errx(1, "%s", clnt_sperrno(clnt_stat)); errx(1, "%s", clnt_sperrno(clnt_stat));
} }
void static void
usage(void) usage(void)
{ {
fprintf(stderr, "usage: %s [-la] [hosts ...]\n", getprogname()); fprintf(stderr, "usage: %s [-la] [hosts ...]\n", getprogname());

View File

@ -1,4 +1,4 @@
/* $NetBSD: script.c,v 1.20 2011/06/08 13:51:13 yamt Exp $ */ /* $NetBSD: script.c,v 1.21 2011/09/06 18:29:56 joerg Exp $ */
/* /*
* Copyright (c) 1980, 1992, 1993 * Copyright (c) 1980, 1992, 1993
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1992, 1993\
#if 0 #if 0
static char sccsid[] = "@(#)script.c 8.1 (Berkeley) 6/6/93"; static char sccsid[] = "@(#)script.c 8.1 (Berkeley) 6/6/93";
#endif #endif
__RCSID("$NetBSD: script.c,v 1.20 2011/06/08 13:51:13 yamt Exp $"); __RCSID("$NetBSD: script.c,v 1.21 2011/09/06 18:29:56 joerg Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/types.h> #include <sys/types.h>
@ -73,26 +73,25 @@ struct stamp {
uint32_t scr_direction; /* 'i', 'o', etc (also indicates endianness) */ uint32_t scr_direction; /* 'i', 'o', etc (also indicates endianness) */
}; };
FILE *fscript; static FILE *fscript;
int master, slave; static int master, slave;
int child, subchild; static int child, subchild;
int outcc; static int outcc;
int usesleep, rawout; static int usesleep, rawout;
int quiet, flush; static int quiet, flush;
const char *fname; static const char *fname;
struct termios tt; static struct termios tt;
void done(void); __dead static void done(void);
void dooutput(void); __dead static void dooutput(void);
void doshell(const char *); __dead static void doshell(const char *);
void fail(void); __dead static void fail(void);
void finish(int); static void finish(int);
int main(int, char **); static void scriptflush(int);
void scriptflush(int); static void record(FILE *, char *, size_t, int);
void record(FILE *, char *, size_t, int); static void consume(FILE *, off_t, char *, int);
void consume(FILE *, off_t, char *, int); __dead static void playback(FILE *);
void playback(FILE *);
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
@ -197,7 +196,7 @@ main(int argc, char *argv[])
return (0); return (0);
} }
void static void
finish(int signo) finish(int signo)
{ {
int die, pid, status; int die, pid, status;
@ -211,7 +210,7 @@ finish(int signo)
done(); done();
} }
void static void
dooutput(void) dooutput(void)
{ {
struct itimerval value; struct itimerval value;
@ -247,7 +246,7 @@ dooutput(void)
done(); done();
} }
void static void
scriptflush(int signo) scriptflush(int signo)
{ {
if (outcc) { if (outcc) {
@ -256,7 +255,7 @@ scriptflush(int signo)
} }
} }
void static void
doshell(const char *command) doshell(const char *command)
{ {
const char *shell; const char *shell;
@ -278,16 +277,16 @@ doshell(const char *command)
fail(); fail();
} }
void static void
fail() fail(void)
{ {
(void)kill(0, SIGTERM); (void)kill(0, SIGTERM);
done(); done();
} }
void static void
done() done(void)
{ {
time_t tvec; time_t tvec;
@ -308,7 +307,7 @@ done()
exit(0); exit(0);
} }
void static void
record(FILE *fp, char *buf, size_t cc, int direction) record(FILE *fp, char *buf, size_t cc, int direction)
{ {
struct iovec iov[2]; struct iovec iov[2];
@ -328,7 +327,7 @@ record(FILE *fp, char *buf, size_t cc, int direction)
err(1, "writev"); err(1, "writev");
} }
void static void
consume(FILE *fp, off_t len, char *buf, int reg) consume(FILE *fp, off_t len, char *buf, int reg)
{ {
size_t l; size_t l;
@ -356,7 +355,7 @@ consume(FILE *fp, off_t len, char *buf, int reg)
} \ } \
} while (0/*CONSTCOND*/) } while (0/*CONSTCOND*/)
void static void
playback(FILE *fp) playback(FILE *fp)
{ {
struct timespec tsi, tso; struct timespec tsi, tso;