diff options
author | alfred <alfred@FreeBSD.org> | 2001-04-25 18:40:38 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2001-04-25 18:40:38 +0000 |
commit | 026a60d7920448487a0d2accf449d1c63a5b309e (patch) | |
tree | 679624f14d7e199770cafaecf0f474d03d6a6ac4 | |
parent | 82f8beb7b024545dac50a53776e8e28956aa5a20 (diff) | |
download | FreeBSD-src-026a60d7920448487a0d2accf449d1c63a5b309e.zip FreeBSD-src-026a60d7920448487a0d2accf449d1c63a5b309e.tar.gz |
Fix compiling without -O, some dead code was using non-existant functions,
make the code not automatically dead but actually use the debug level
in order to determine if output is needed. Fix non-existant from_addr()
by #define'ing it to inet_ntoa().
Remove hardcoded -g from Makefile.
Reported by: "John W. De Boskey" <jwd@bsdwins.com>
Tested by: "John W. De Boskey" <jwd@bsdwins.com>
-rw-r--r-- | usr.sbin/rpc.lockd/Makefile | 2 | ||||
-rw-r--r-- | usr.sbin/rpc.lockd/kern.c | 14 |
2 files changed, 10 insertions, 6 deletions
diff --git a/usr.sbin/rpc.lockd/Makefile b/usr.sbin/rpc.lockd/Makefile index 2e8aa47..fad4a76 100644 --- a/usr.sbin/rpc.lockd/Makefile +++ b/usr.sbin/rpc.lockd/Makefile @@ -6,7 +6,7 @@ SRCS= kern.c nlm_prot_svc.c lockd.c lock_proc.c lockd_lock.c MAN= rpc.lockd.8 MLINKS= rpc.lockd.8 lockd.8 -CFLAGS+= -I. -I${DESTDIR}/usr/include/rpcsvc -g +CFLAGS+= -I. -I${DESTDIR}/usr/include/rpcsvc DPADD= ${LIBRPCSVC} ${LIBUTIL} LDADD= -lrpcsvc -lutil diff --git a/usr.sbin/rpc.lockd/kern.c b/usr.sbin/rpc.lockd/kern.c index 730646c..b7788fd 100644 --- a/usr.sbin/rpc.lockd/kern.c +++ b/usr.sbin/rpc.lockd/kern.c @@ -80,8 +80,11 @@ int unlock_request(LOCKD_MSG *); #define lockd_seteuid(uid) (1) #endif -#define d_calls 0 -#define d_args 0 +#define d_calls (debug_level > 1) +#define d_args (debug_level > 2) + +#define from_addr(sockaddr) \ + (inet_ntoa((sockaddr)->sin_addr)) void client_cleanup(sig, code) @@ -451,9 +454,10 @@ lock_answer(int pid, netobj *netcookie, int result, int *pid_p, int version) } if (d_calls) - syslog(LOG_DEBUG, "lock answer: pid %lu: %s", - ans.la_msg_ident.pid, version == NLM_VERS4 ? - show_4state(result) : show_state(result)); + syslog(LOG_DEBUG, "lock answer: pid %lu: %s %d", + ans.la_msg_ident.pid, + version == NLM_VERS4 ? "nlmv4" : "nlmv3", + result); ans.la_set_getlk_pid = 0; if (version == NLM_VERS4) |