diff options
author | jmallett <jmallett@FreeBSD.org> | 2002-06-21 11:18:42 +0000 |
---|---|---|
committer | jmallett <jmallett@FreeBSD.org> | 2002-06-21 11:18:42 +0000 |
commit | 1bb36586265ee32c6ab1b68133d3a8a235aa2dcb (patch) | |
tree | 915e0a4ae8ebfe232a33edaa99f8e7d58c8e52e8 /usr.sbin/inetd | |
parent | cea30675defd757a79bac882e55df43bd13a2d91 (diff) | |
download | FreeBSD-src-1bb36586265ee32c6ab1b68133d3a8a235aa2dcb.zip FreeBSD-src-1bb36586265ee32c6ab1b68133d3a8a235aa2dcb.tar.gz |
ANSI prototypes via protoize(1).
Diffstat (limited to 'usr.sbin/inetd')
-rw-r--r-- | usr.sbin/inetd/builtins.c | 80 | ||||
-rw-r--r-- | usr.sbin/inetd/inetd.c | 84 |
2 files changed, 64 insertions, 100 deletions
diff --git a/usr.sbin/inetd/builtins.c b/usr.sbin/inetd/builtins.c index 08c3c56..9cc73b0 100644 --- a/usr.sbin/inetd/builtins.c +++ b/usr.sbin/inetd/builtins.c @@ -106,7 +106,7 @@ struct biltin biltins[] = { */ void -initring() +initring(void) { int i; @@ -119,9 +119,9 @@ initring() /* ARGSUSED */ void -chargen_dg(s, sep) /* Character generator */ - int s; - struct servtab *sep; +chargen_dg(int s, struct servtab *sep) /* Character generator */ + + { struct sockaddr_storage ss; static char *rs; @@ -157,9 +157,9 @@ chargen_dg(s, sep) /* Character generator */ /* ARGSUSED */ void -chargen_stream(s, sep) /* Character generator */ - int s; - struct servtab *sep; +chargen_stream(int s, struct servtab *sep) /* Character generator */ + + { int len; char *rs, text[LINESIZ+2]; @@ -195,9 +195,9 @@ chargen_stream(s, sep) /* Character generator */ /* ARGSUSED */ void -daytime_dg(s, sep) /* Return human-readable time of day */ - int s; - struct servtab *sep; +daytime_dg(int s, struct servtab *sep) /* Return human-readable time of day */ + + { char buffer[256]; time_t now; @@ -221,9 +221,9 @@ daytime_dg(s, sep) /* Return human-readable time of day */ /* ARGSUSED */ void -daytime_stream(s, sep) /* Return human-readable time of day */ - int s; - struct servtab *sep __unused; +daytime_stream(int s, struct servtab *sep) /* Return human-readable time of day */ + + { char buffer[256]; time_t now; @@ -241,9 +241,9 @@ daytime_stream(s, sep) /* Return human-readable time of day */ /* ARGSUSED */ void -discard_dg(s, sep) /* Discard service -- ignore data */ - int s; - struct servtab *sep __unused; +discard_dg(int s, struct servtab *sep) /* Discard service -- ignore data */ + + { char buffer[BUFSIZE]; @@ -252,9 +252,9 @@ discard_dg(s, sep) /* Discard service -- ignore data */ /* ARGSUSED */ void -discard_stream(s, sep) /* Discard service -- ignore data */ - int s; - struct servtab *sep; +discard_stream(int s, struct servtab *sep) /* Discard service -- ignore data */ + + { int ret; char buffer[BUFSIZE]; @@ -276,9 +276,9 @@ discard_stream(s, sep) /* Discard service -- ignore data */ /* ARGSUSED */ void -echo_dg(s, sep) /* Echo service -- echo data back */ - int s; - struct servtab *sep; +echo_dg(int s, struct servtab *sep) /* Echo service -- echo data back */ + + { char buffer[65536]; /* Should be sizeof(max datagram). */ int i; @@ -298,9 +298,9 @@ echo_dg(s, sep) /* Echo service -- echo data back */ /* ARGSUSED */ void -echo_stream(s, sep) /* Echo service -- echo data back */ - int s; - struct servtab *sep; +echo_stream(int s, struct servtab *sep) /* Echo service -- echo data back */ + + { char buffer[BUFSIZE]; int i; @@ -327,9 +327,9 @@ echo_stream(s, sep) /* Echo service -- echo data back */ /* ARGSUSED */ void -iderror(lport, fport, s, er) /* Generic ident_stream error-sending func */ - int lport, fport, s; - const char *er; +iderror(int lport, int fport, int s, const char *er) /* Generic ident_stream error-sending func */ + + { char *p; @@ -346,9 +346,9 @@ iderror(lport, fport, s, er) /* Generic ident_stream error-sending func */ /* ARGSUSED */ void -ident_stream(s, sep) /* Ident service (AKA "auth") */ - int s; - struct servtab *sep; +ident_stream(int s, struct servtab *sep) /* Ident service (AKA "auth") */ + + { struct utsname un; struct stat sb; @@ -696,7 +696,7 @@ printit: */ unsigned long -machtime() +machtime(void) { struct timeval tv; @@ -712,9 +712,7 @@ machtime() /* ARGSUSED */ void -machtime_dg(s, sep) - int s; - struct servtab *sep; +machtime_dg(int s, struct servtab *sep) { unsigned long result; struct sockaddr_storage ss; @@ -735,9 +733,7 @@ machtime_dg(s, sep) /* ARGSUSED */ void -machtime_stream(s, sep) - int s; - struct servtab *sep __unused; +machtime_stream(int s, struct servtab *sep) { unsigned long result; @@ -757,10 +753,7 @@ machtime_stream(s, sep) #define strwrite(fd, buf) (void) write(fd, buf, sizeof(buf)-1) static int /* # of characters upto \r,\n or \0 */ -getline(fd, buf, len) - int fd; - char *buf; - int len; +getline(int fd, char *buf, int len) { int count = 0, n; struct sigaction sa; @@ -788,8 +781,7 @@ getline(fd, buf, len) } struct servtab * -tcpmux(s) - int s; +tcpmux(int s) { struct servtab *sep; char service[MAX_SERV_LEN+1]; diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c index ee6e8b6..ec6e78d 100644 --- a/usr.sbin/inetd/inetd.c +++ b/usr.sbin/inetd/inetd.c @@ -268,9 +268,7 @@ const char *CONFIG = _PATH_INETDCONF; const char *pid_file = _PATH_INETDPID; int -getvalue(arg, value, whine) - const char *arg, *whine; - int *value; +getvalue(const char *arg, int *value, const char *whine) { int tmp; char *p; @@ -285,9 +283,7 @@ getvalue(arg, value, whine) } int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { struct servtab *sep; struct passwd *pwd; @@ -807,8 +803,7 @@ main(argc, argv) */ void -flag_signal(c) - int c; +flag_signal(int c) { char ch = c; @@ -845,14 +840,13 @@ addchild(struct servtab *sep, pid_t pid) */ void -flag_reapchild(signo) - int signo __unused; +flag_reapchild(int signo) { flag_signal('C'); } void -reapchild() +reapchild(void) { int k, status; pid_t pid; @@ -883,14 +877,13 @@ reapchild() } void -flag_config(signo) - int signo __unused; +flag_config(int signo) { flag_signal('H'); } void -config() +config(void) { struct servtab *sep, *new, **sepp; long omask; @@ -1084,8 +1077,7 @@ config() } void -unregisterrpc(sep) - struct servtab *sep; +unregisterrpc(struct servtab *sep) { u_int i; struct servtab *sepp; @@ -1112,14 +1104,13 @@ unregisterrpc(sep) } void -flag_retry(signo) - int signo __unused; +flag_retry(int signo) { flag_signal('A'); } void -retry() +retry(void) { struct servtab *sep; @@ -1130,8 +1121,7 @@ retry() } void -setup(sep) - struct servtab *sep; +setup(struct servtab *sep) { int on = 1; @@ -1330,8 +1320,7 @@ ipsecsetup(sep) * Finish with a service and its socket. */ void -close_sep(sep) - struct servtab *sep; +close_sep(struct servtab *sep) { if (sep->se_fd >= 0) { if (FD_ISSET(sep->se_fd, &allsock)) @@ -1344,8 +1333,7 @@ close_sep(sep) } int -matchservent(name1, name2, proto) - const char *name1, *name2, *proto; +matchservent(const char *name1, const char *name2, const char *proto) { char **alias, *p; struct servent *se; @@ -1369,8 +1357,7 @@ matchservent(name1, name2, proto) } struct servtab * -enter(cp) - struct servtab *cp; +enter(struct servtab *cp) { struct servtab *sep; long omask; @@ -1390,8 +1377,7 @@ enter(cp) } void -enable(sep) - struct servtab *sep; +enable(struct servtab *sep) { if (debug) warnx( @@ -1420,8 +1406,7 @@ enable(sep) } void -disable(sep) - struct servtab *sep; +disable(struct servtab *sep) { if (debug) warnx( @@ -1458,7 +1443,7 @@ struct servtab serv; char line[LINE_MAX]; int -setconfig() +setconfig(void) { if (fconfig != NULL) { @@ -1470,7 +1455,7 @@ setconfig() } void -endconfig() +endconfig(void) { if (fconfig) { (void) fclose(fconfig); @@ -1479,7 +1464,7 @@ endconfig() } struct servtab * -getconfigent() +getconfigent(void) { struct servtab *sep = &serv; int argc; @@ -1847,8 +1832,7 @@ more: } void -freeconfig(cp) - struct servtab *cp; +freeconfig(struct servtab *cp) { int i; @@ -1883,8 +1867,7 @@ freeconfig(cp) * configuration file and exit. */ char * -sskip(cpp) - char **cpp; +sskip(char **cpp) { char *cp; @@ -1897,8 +1880,7 @@ sskip(cpp) } char * -skip(cpp) - char **cpp; +skip(char **cpp) { char *cp = *cpp; char *start; @@ -1934,8 +1916,7 @@ again: } char * -nextline(fd) - FILE *fd; +nextline(FILE *fd) { char *cp; @@ -1948,8 +1929,7 @@ nextline(fd) } char * -newstr(cp) - const char *cp; +newstr(const char *cp) { char *cr; @@ -1960,9 +1940,7 @@ newstr(cp) } void -inetd_setproctitle(a, s) - const char *a; - int s; +inetd_setproctitle(const char *a, int s) { socklen_t size; struct sockaddr_storage ss; @@ -1979,9 +1957,7 @@ inetd_setproctitle(a, s) } int -check_loop(sa, sep) - const struct sockaddr *sa; - const struct servtab *sep; +check_loop(const struct sockaddr *sa, const struct servtab *sep) { struct servtab *se2; char pname[INET6_ADDRSTRLEN]; @@ -2023,9 +1999,7 @@ check_loop(sa, sep) * Dump relevant information to stderr */ void -print_service(action, sep) - const char *action; - const struct servtab *sep; +print_service(const char *action, const struct servtab *sep) { fprintf(stderr, "%s: %s proto=%s accept=%d max=%d user=%s group=%s" @@ -2075,9 +2049,7 @@ typedef struct CHash { CHash CHashAry[CPMHSIZE]; int -cpmip(sep, ctrl) - const struct servtab *sep; - int ctrl; +cpmip(const struct servtab *sep, int ctrl) { struct sockaddr_storage rss; socklen_t rssLen = sizeof(rss); |