summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rpc.lockd
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>2005-05-20 13:01:47 +0000
committercharnier <charnier@FreeBSD.org>2005-05-20 13:01:47 +0000
commit80a7e91a6f59170ea94cf7cc2ccd728e9717d96c (patch)
treef678b3d6fe90978e918c371d80b55e50dfa955e1 /usr.sbin/rpc.lockd
parentdded2f511b93bdc7caff86f0e0c41767c4d7c84f (diff)
downloadFreeBSD-src-80a7e91a6f59170ea94cf7cc2ccd728e9717d96c.zip
FreeBSD-src-80a7e91a6f59170ea94cf7cc2ccd728e9717d96c.tar.gz
Add FBSDID. Add missing prototypes. Remove unused variables. Give variable
an initial value to silent compiler.
Diffstat (limited to 'usr.sbin/rpc.lockd')
-rw-r--r--usr.sbin/rpc.lockd/kern.c13
-rw-r--r--usr.sbin/rpc.lockd/lockd_lock.c16
2 files changed, 15 insertions, 14 deletions
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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include <sys/param.h>
#include <sys/mount.h>
#include <sys/queue.h>
@@ -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 <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#define LOCKD_DEBUG
#include <stdio.h>
@@ -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;
}
OpenPOWER on IntegriCloud