From owner-svn-src-head@FreeBSD.ORG Mon Dec 20 21:12:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41F81106564A; Mon, 20 Dec 2010 21:12:19 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 304D08FC13; Mon, 20 Dec 2010 21:12:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBKLCJh4086843; Mon, 20 Dec 2010 21:12:19 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBKLCJai086837; Mon, 20 Dec 2010 21:12:19 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201012202112.oBKLCJai086837@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 20 Dec 2010 21:12:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216603 - in head: include usr.sbin/rpc.lockd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Dec 2010 21:12:19 -0000 Author: uqs Date: Mon Dec 20 21:12:18 2010 New Revision: 216603 URL: http://svn.freebsd.org/changeset/base/216603 Log: rpc.lockd(8) WARNS cleanup - Provide function prototype for nlm_syscall - Don't assign a variable from the stack to a global var[1] - Remove unused vars Found by: clang static analyser [1] Reviewed by: dfr Modified: head/include/unistd.h head/usr.sbin/rpc.lockd/Makefile head/usr.sbin/rpc.lockd/lockd.c head/usr.sbin/rpc.lockd/lockd_lock.c Modified: head/include/unistd.h ============================================================================== --- head/include/unistd.h Mon Dec 20 20:39:49 2010 (r216602) +++ head/include/unistd.h Mon Dec 20 21:12:18 2010 (r216603) @@ -529,6 +529,7 @@ char *mktemp(char *); #define _MKTEMP_DECLARED #endif int nfssvc(int, void *); +int nlm_syscall(int, int, int, char **); int profil(char *, size_t, vm_offset_t, int); int rcmd(char **, int, const char *, const char *, const char *, int *); int rcmd_af(char **, int, const char *, Modified: head/usr.sbin/rpc.lockd/Makefile ============================================================================== --- head/usr.sbin/rpc.lockd/Makefile Mon Dec 20 20:39:49 2010 (r216602) +++ head/usr.sbin/rpc.lockd/Makefile Mon Dec 20 21:12:18 2010 (r216603) @@ -7,7 +7,7 @@ MLINKS= rpc.lockd.8 lockd.8 SRCS= kern.c nlm_prot_svc.c lockd.c lock_proc.c lockd_lock.c CFLAGS+= -I. -I${DESTDIR}/usr/include/rpcsvc -WARNS?= 0 +WARNS?= 3 DPADD= ${LIBRPCSVC} ${LIBUTIL} LDADD= -lrpcsvc -lutil Modified: head/usr.sbin/rpc.lockd/lockd.c ============================================================================== --- head/usr.sbin/rpc.lockd/lockd.c Mon Dec 20 20:39:49 2010 (r216602) +++ head/usr.sbin/rpc.lockd/lockd.c Mon Dec 20 21:12:18 2010 (r216603) @@ -88,6 +88,7 @@ int nhosts = 0; int xcreated = 0; char **addrs; /* actually (netid, uaddr) pairs */ int naddrs; /* count of how many (netid, uaddr) pairs */ +char localhost[] = "localhost"; void create_service(struct netconfig *nconf); void lookup_addresses(struct netconfig *nconf); @@ -626,11 +627,8 @@ lookup_addresses(struct netconfig *nconf struct sockaddr_in6 *sin6; struct __rpc_sockinfo si; struct netbuf servaddr; - SVCXPRT *transp = NULL; int aicode; int nhostsbak; - int r; - int registered = 0; u_int32_t host_addr[4]; /* IPv4 or IPv6 */ char *uaddr; @@ -789,7 +787,6 @@ init_nsm(void) my_id id; sm_stat stat; char name[] = "NFS NLM"; - char localhost[] = "localhost"; /* * !!! Modified: head/usr.sbin/rpc.lockd/lockd_lock.c ============================================================================== --- head/usr.sbin/rpc.lockd/lockd_lock.c Mon Dec 20 20:39:49 2010 (r216602) +++ head/usr.sbin/rpc.lockd/lockd_lock.c Mon Dec 20 21:12:18 2010 (r216603) @@ -197,6 +197,7 @@ enum hwlock_status lock_hwlock(struct fi enum split_status split_nfslock(const struct file_lock *exist_lock, const struct file_lock *unlock_lock, struct file_lock **left_lock, struct file_lock **right_lock); +int duplicate_block(struct file_lock *fl); void add_blockingfilelock(struct file_lock *fl); enum hwlock_status unlock_hwlock(const struct file_lock *fl); enum hwlock_status test_hwlock(const struct file_lock *fl, @@ -1198,7 +1199,7 @@ test_hwlock(fl, conflicting_fl) int duplicate_block(struct file_lock *fl) { - struct file_lock *ifl,*nfl; + struct file_lock *ifl; int retval = 0; debuglog("Entering duplicate_block");