Module Name:    src
Committed By:   pooka
Date:           Wed Jul 14 14:22:16 UTC 2010

Modified Files:
        src/tests/fs/puffs/h_dtfs: dtfs_vnops.c

Log Message:
check we don't rename onto a non-empty directory


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/puffs/h_dtfs/dtfs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/fs/puffs/h_dtfs/dtfs_vnops.c
diff -u src/tests/fs/puffs/h_dtfs/dtfs_vnops.c:1.2 src/tests/fs/puffs/h_dtfs/dtfs_vnops.c:1.3
--- src/tests/fs/puffs/h_dtfs/dtfs_vnops.c:1.2	Wed Jul 14 13:09:52 2010
+++ src/tests/fs/puffs/h_dtfs/dtfs_vnops.c	Wed Jul 14 14:22:15 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dtfs_vnops.c,v 1.2 2010/07/14 13:09:52 pooka Exp $	*/
+/*	$NetBSD: dtfs_vnops.c,v 1.3 2010/07/14 14:22:15 pooka Exp $	*/
 
 /*
  * Copyright (c) 2006  Antti Kantee.  All Rights Reserved.
@@ -304,6 +304,7 @@
 	const struct puffs_cn *pcn_targ)
 {
 	struct dtfs_dirent *dfd_src;
+	struct dtfs_file *df_targ;
 	struct puffs_node *pn_sdir = opc;
 	struct puffs_node *pn_sfile = src;
 	struct puffs_node *pn_tdir = targ_dir;
@@ -325,7 +326,9 @@
 	/* if there's a target file, nuke it for atomic replacement */
 	if (pn_tfile) {
 		if (pn_tfile->pn_va.va_type == VDIR) {
-			assert(/*CONSTCOND*/0); /* XXX FIXME */
+			df_targ = DTFS_CTOF(pn_tfile);
+			if (!LIST_EMPTY(&df_targ->df_dirents))
+				return ENOTEMPTY;
 		}
 		dtfs_nukenode(pn_tfile, pn_sdir,
 		    pcn_targ->pcn_name, pcn_targ->pcn_namelen);

Reply via email to