summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rpc.lockd
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2001-04-25 18:40:38 +0000
committeralfred <alfred@FreeBSD.org>2001-04-25 18:40:38 +0000
commit026a60d7920448487a0d2accf449d1c63a5b309e (patch)
tree679624f14d7e199770cafaecf0f474d03d6a6ac4 /usr.sbin/rpc.lockd
parent82f8beb7b024545dac50a53776e8e28956aa5a20 (diff)
downloadFreeBSD-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>
Diffstat (limited to 'usr.sbin/rpc.lockd')
-rw-r--r--usr.sbin/rpc.lockd/Makefile2
-rw-r--r--usr.sbin/rpc.lockd/kern.c14
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)
OpenPOWER on IntegriCloud