Add FBSDID. Add missing prototypes. Remove unused variables. Give variable
an initial value to silent compiler.
This commit is contained in:
parent
20b5a7b446
commit
7838f9dd89
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=146445
@ -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 . */
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user