From 80a7e91a6f59170ea94cf7cc2ccd728e9717d96c Mon Sep 17 00:00:00 2001 From: charnier Date: Fri, 20 May 2005 13:01:47 +0000 Subject: Add FBSDID. Add missing prototypes. Remove unused variables. Give variable an initial value to silent compiler. --- usr.sbin/rpc.lockd/kern.c | 13 +++++++------ usr.sbin/rpc.lockd/lockd_lock.c | 16 ++++++++-------- 2 files changed, 15 insertions(+), 14 deletions(-) (limited to 'usr.sbin/rpc.lockd') diff --git a/usr.sbin/rpc.lockd/kern.c b/usr.sbin/rpc.lockd/kern.c index 416b77d..ef5d268 100644 --- a/usr.sbin/rpc.lockd/kern.c +++ b/usr.sbin/rpc.lockd/kern.c @@ -26,9 +26,11 @@ * SUCH DAMAGE. * * from BSDI kern.c,v 1.2 1998/11/25 22:38:27 don Exp - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -69,14 +71,15 @@ typedef struct __owner { static OWNER owner; static char hostname[MAXHOSTNAMELEN + 1]; /* Hostname. */ +static int devfd; static void client_cleanup(void); -static void set_auth(CLIENT *cl, struct xucred *ucred); +static const char *from_addr(struct sockaddr *); int lock_request(LOCKD_MSG *); -int test_request(LOCKD_MSG *); +static void set_auth(CLIENT *cl, struct xucred *ucred); void show(LOCKD_MSG *); +int test_request(LOCKD_MSG *); int unlock_request(LOCKD_MSG *); -static int devfd; static int nfslockdans(int vers, struct lockd_ans *ansp) @@ -122,11 +125,9 @@ pid_t client_request(void) { LOCKD_MSG msg; - fd_set rdset; int nr, ret; pid_t child; uid_t daemon_uid; - mode_t old_umask; struct passwd *pw; /* Open the dev . */ diff --git a/usr.sbin/rpc.lockd/lockd_lock.c b/usr.sbin/rpc.lockd/lockd_lock.c index b67a40c..ee9f337 100644 --- a/usr.sbin/rpc.lockd/lockd_lock.c +++ b/usr.sbin/rpc.lockd/lockd_lock.c @@ -1,5 +1,4 @@ /* $NetBSD: lockd_lock.c,v 1.5 2000/11/21 03:47:41 enami Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 2001 Andrew P. Lentvorski, Jr. @@ -35,6 +34,9 @@ * */ +#include +__FBSDID("$FreeBSD$"); + #define LOCKD_DEBUG #include @@ -212,7 +214,7 @@ enum nlm_stats do_test(struct file_lock *fl, enum nlm_stats do_unlock(struct file_lock *fl); enum nlm_stats do_lock(struct file_lock *fl); void do_clear(const char *hostname); - +size_t strnlen(const char *, size_t); void debuglog(char const *fmt, ...) @@ -520,12 +522,11 @@ region_compare(starte, lene, startu, lenu, if (lene == 0 && lenu == 0) { /* Examine left edge of locker */ + lflags = LEDGE_INSIDE; if (startu < starte) { lflags = LEDGE_LEFT; } else if (startu == starte) { lflags = LEDGE_LBOUNDARY; - } else { - lflags = LEDGE_INSIDE; } rflags = REDGE_RBOUNDARY; /* Both are infiinite */ @@ -543,12 +544,11 @@ region_compare(starte, lene, startu, lenu, } else if (lene == 0 && lenu != 0) { /* Established lock is infinite */ /* Examine left edge of unlocker */ + lflags = LEDGE_INSIDE; if (startu < starte) { lflags = LEDGE_LEFT; } else if (startu == starte) { lflags = LEDGE_LBOUNDARY; - } else if (startu > starte) { - lflags = LEDGE_INSIDE; } /* Examine right edge of unlocker */ @@ -580,6 +580,7 @@ region_compare(starte, lene, startu, lenu, } else if (lene != 0 && lenu == 0) { /* Unlocker is infinite */ /* Examine left edge of unlocker */ + lflags = LEDGE_RIGHT; if (startu < starte) { lflags = LEDGE_LEFT; retval = SPL_CONTAINED; @@ -605,11 +606,11 @@ region_compare(starte, lene, startu, lenu, retval |= SPL_LOCK1; return retval; } - } else { /* Both locks are finite */ /* Examine left edge of unlocker */ + lflags = LEDGE_RIGHT; if (startu < starte) { lflags = LEDGE_LEFT; } else if (startu == starte) { @@ -662,7 +663,6 @@ region_compare(starte, lene, startu, lenu, retval = SPL_CONTAINED; } } - return retval; } -- cgit v1.1