From 45e9b9e5b132ab0571210a671695d1d8dcc5f882 Mon Sep 17 00:00:00 2001
From: Thomas Bushnell <thomas@gnu.org>
Date: Tue, 29 Jun 1999 08:00:50 +0000
Subject: 1999-06-29  Thomas Bushnell, BSG  <tb@mit.edu>

	* lookup.c (diskfs_lookup): If we get an error from
	fshelp_checkdirmod, clear *NP as well as returning the error.
	Use diskfs_nrele instead of diskfs_nput in case *NP and DP are
	the same.

1999-06-28  Thomas Bushnell, BSG  <tb@mit.edu>

	* dir-rmdir.c (diskfs_S_dir_rmdir): Reorganized to make clearer;
	several little buglets fixed too.
---
 libdiskfs/lookup.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'libdiskfs/lookup.c')

diff --git a/libdiskfs/lookup.c b/libdiskfs/lookup.c
index 2dd75a92..3ec9dd87 100644
--- a/libdiskfs/lookup.c
+++ b/libdiskfs/lookup.c
@@ -183,7 +183,13 @@ diskfs_lookup (struct node *dp, const char *name, enum lookup_type type,
 	  if (err2)
 	    {
 	      if (np && !err)
-		diskfs_nput (*np);
+		{
+		  if (*np == dp)
+		    diskfs_nrele (*np);
+		  else
+		    diskfs_nput (*np);
+		  *np = 0;
+		}
 	      return err2;
 	    }
 	}
-- 
cgit v1.2.3