Make pu_haskq a flag instead of its own variable.

This commit is contained in:
pooka 2007-10-25 10:59:45 +00:00
parent 1b23a1904b
commit 5643bf6454
2 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: puffs.c,v 1.67 2007/10/21 19:25:58 pooka Exp $ */
/* $NetBSD: puffs.c,v 1.68 2007/10/25 10:59:45 pooka Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved.
@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if !defined(lint)
__RCSID("$NetBSD: puffs.c,v 1.67 2007/10/21 19:25:58 pooka Exp $");
__RCSID("$NetBSD: puffs.c,v 1.68 2007/10/25 10:59:45 pooka Exp $");
#endif /* !lint */
#include <sys/param.h>
@ -461,7 +461,7 @@ puffs_exit(struct puffs_usermount *pu, int force)
puffs_pn_put(pn);
puffs_framev_exit(pu);
if (pu->pu_haskq)
if (pu->pu_state & PU_HASKQ)
close(pu->pu_kq);
free(pu);
@ -504,7 +504,7 @@ puffs_mainloop(struct puffs_usermount *pu, int flags)
pu->pu_kq = kqueue();
if (pu->pu_kq == -1)
goto out;
pu->pu_haskq = 1;
pu->pu_state |= PU_HASKQ;
curev = pfctrl->evs;
LIST_FOREACH(fio, &pfctrl->fb_ios, fio_entries) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: puffs_priv.h,v 1.25 2007/10/21 19:25:58 pooka Exp $ */
/* $NetBSD: puffs_priv.h,v 1.26 2007/10/25 10:59:45 pooka Exp $ */
/*
* Copyright (c) 2006 Antti Kantee. All Rights Reserved.
@ -100,11 +100,11 @@ struct puffs_usermount {
size_t pu_cc_stacksize;
int pu_kq;
int pu_haskq;
int pu_state;
#define PU_STATEMASK 0xff
#define PU_INLOOP 0x100
#define PU_ASYNCFD 0x200
#define PU_HASKQ 0x400
#define PU_SETSTATE(pu, s) (pu->pu_state = (s) | (pu->pu_state & ~PU_STATEMASK))
struct puffs_node *pu_pn_root;