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:
parent
bb61024d88
commit
5f8568ec81
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=75979
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user