From 8215b8c2bc737d53df519257a70975ffe082dc8a Mon Sep 17 00:00:00 2001 From: pooka Date: Tue, 16 Oct 2007 10:53:02 +0000 Subject: [PATCH] Close file handles if opencount drops to zero instead of closing them if it does not drop to zero, i.e. fix a pretty obvious bug. --- usr.sbin/puffs/mount_psshfs/node.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/usr.sbin/puffs/mount_psshfs/node.c b/usr.sbin/puffs/mount_psshfs/node.c index d0945a91749c..5c66e98f4e32 100644 --- a/usr.sbin/puffs/mount_psshfs/node.c +++ b/usr.sbin/puffs/mount_psshfs/node.c @@ -1,4 +1,4 @@ -/* $NetBSD: node.c,v 1.39 2007/08/24 13:33:51 pooka Exp $ */ +/* $NetBSD: node.c,v 1.40 2007/10/16 10:53:02 pooka Exp $ */ /* * Copyright (c) 2006 Antti Kantee. All Rights Reserved. @@ -27,7 +27,7 @@ #include #ifndef lint -__RCSID("$NetBSD: node.c,v 1.39 2007/08/24 13:33:51 pooka Exp $"); +__RCSID("$NetBSD: node.c,v 1.40 2007/10/16 10:53:02 pooka Exp $"); #endif /* !lint */ #include @@ -296,10 +296,8 @@ psshfs_node_close(struct puffs_cc *pcc, void *opc, int flags, struct psshfs_node *psn = pn->pn_data; if (psn->opencount > 0) - psn->opencount--; - - if (psn->opencount) - closehandles(pcc, psn); + if (--psn->opencount == 0) + closehandles(pcc, psn); return 0; }