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>
This commit is contained in:
alfred 2001-04-25 18:40:38 +00:00
parent c183120bd9
commit 061236a372
2 changed files with 10 additions and 6 deletions

View File

@ -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

View File

@ -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)