Module Name: src
Committed By: manu
Date: Thu Nov 24 01:55:33 UTC 2011
Modified Files:
src/lib/libpuffs: null.c
Log Message:
Remove pnode of overwritten file.
When puffs_null_node_rename() overwrites existing file, its pnode
must�be removed, because src pnode already represents this file.
>From Evgeniy Ivanov <[email protected]>
To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/lib/libpuffs/null.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libpuffs/null.c
diff -u src/lib/libpuffs/null.c:1.30 src/lib/libpuffs/null.c:1.31
--- src/lib/libpuffs/null.c:1.30 Mon Jun 27 12:06:19 2011
+++ src/lib/libpuffs/null.c Thu Nov 24 01:55:33 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: null.c,v 1.30 2011/06/27 12:06:19 manu Exp $ */
+/* $NetBSD: null.c,v 1.31 2011/11/24 01:55:33 manu Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@@ -27,7 +27,7 @@
#include <sys/cdefs.h>
#if !defined(lint)
-__RCSID("$NetBSD: null.c,v 1.30 2011/06/27 12:06:19 manu Exp $");
+__RCSID("$NetBSD: null.c,v 1.31 2011/11/24 01:55:33 manu Exp $");
#endif /* !lint */
/*
@@ -480,10 +480,14 @@ puffs_null_node_rename(struct puffs_user
puffs_cookie_t targ_dir, puffs_cookie_t targ,
const struct puffs_cn *pcn_targ)
{
+ struct puffs_node *pn_targ = targ;
if (rename(PCNPATH(pcn_src), PCNPATH(pcn_targ)) == -1)
return errno;
+ if (pn_targ)
+ puffs_pn_remove(pn_targ);
+
return 0;
}