diff options
author | araujo <araujo@FreeBSD.org> | 2015-07-28 02:32:40 +0000 |
---|---|---|
committer | araujo <araujo@FreeBSD.org> | 2015-07-28 02:32:40 +0000 |
commit | fafebceb9b4261b02d6bdbab4301b2c00ae3ddf7 (patch) | |
tree | 474a3116b16d6874dad78ef520947dc99f16dd88 /usr.sbin/ypserv | |
parent | 63528763eb4bf746eee1fefdf2e6dbf302f7adea (diff) | |
download | FreeBSD-src-fafebceb9b4261b02d6bdbab4301b2c00ae3ddf7.zip FreeBSD-src-fafebceb9b4261b02d6bdbab4301b2c00ae3ddf7.tar.gz |
Staticfy and constify some variables and clean up the code a bit to make it
more readable. No functional change.
Differential Revision: D3166
Reviewed by: kib
Sponsored by: gandi.net
Diffstat (limited to 'usr.sbin/ypserv')
-rw-r--r-- | usr.sbin/ypserv/yp_access.c | 8 | ||||
-rw-r--r-- | usr.sbin/ypserv/yp_dblookup.c | 2 | ||||
-rw-r--r-- | usr.sbin/ypserv/yp_error.c | 6 | ||||
-rw-r--r-- | usr.sbin/ypserv/yp_main.c | 6 |
4 files changed, 10 insertions, 12 deletions
diff --git a/usr.sbin/ypserv/yp_access.c b/usr.sbin/ypserv/yp_access.c index c82f8c7..a4ba504 100644 --- a/usr.sbin/ypserv/yp_access.c +++ b/usr.sbin/ypserv/yp_access.c @@ -57,8 +57,8 @@ __FBSDID("$FreeBSD$"); extern int debug; - /* NIS v1 */ -const char *yp_procs[] = { +static const char *yp_procs[] = { + /* NIS v1 */ "ypoldproc_null", "ypoldproc_domain", "ypoldproc_domain_nonack", @@ -71,7 +71,7 @@ const char *yp_procs[] = { "badproc1", /* placeholder */ "badproc2", /* placeholder */ "badproc3", /* placeholder */ - + /* NIS v2 */ "ypproc_null", "ypproc_domain", @@ -93,7 +93,7 @@ struct securenet { struct securenet *next; }; -struct securenet *securenets; +static struct securenet *securenets; #define LINEBUFSZ 1024 diff --git a/usr.sbin/ypserv/yp_dblookup.c b/usr.sbin/ypserv/yp_dblookup.c index 61944dc..6a3bf1c 100644 --- a/usr.sbin/ypserv/yp_dblookup.c +++ b/usr.sbin/ypserv/yp_dblookup.c @@ -405,7 +405,7 @@ yp_open_db(const char *domain, const char *map) #ifdef DB_CACHE again: #endif - dbp = dbopen(buf,O_RDONLY, PERM_SECURE, DB_HASH, NULL); + dbp = dbopen(buf, O_RDONLY, PERM_SECURE, DB_HASH, NULL); if (dbp == NULL) { switch (errno) { diff --git a/usr.sbin/ypserv/yp_error.c b/usr.sbin/ypserv/yp_error.c index 8d488f3..a5b1290 100644 --- a/usr.sbin/ypserv/yp_error.c +++ b/usr.sbin/ypserv/yp_error.c @@ -46,13 +46,13 @@ __FBSDID("$FreeBSD$"); #include "yp_extern.h" int debug; -extern int _rpcpmstart; +extern int _rpcpmstart; extern char *progname; - static void __verr(const char *fmt, va_list ap) __printflike(1, 0); -static void __verr(const char *fmt, va_list ap) +static void +__verr(const char *fmt, va_list ap) { if (debug && !_rpcpmstart) { fprintf(stderr,"%s: ",progname); diff --git a/usr.sbin/ypserv/yp_main.c b/usr.sbin/ypserv/yp_main.c index 958d3a6..8c538ca 100644 --- a/usr.sbin/ypserv/yp_main.c +++ b/usr.sbin/ypserv/yp_main.c @@ -72,13 +72,11 @@ __FBSDID("$FreeBSD$"); #define _RPCSVC_CLOSEDOWN 120 int _rpcpmstart; /* Started by a port monitor ? */ -static int _rpcfdtype; - /* Whether Stream or Datagram ? */ +static int _rpcfdtype; /* Whether Stream or Datagram? */ static int _rpcaf; static int _rpcfd; - /* States a server can be in wrt request */ - +/* States a server can be in wrt request */ #define _IDLE 0 #define _SERVED 1 #define _SERVING 2 |