rpms/autofs/devel autofs-5.0.1-rc3-do_mkdir-return-status.patch, NONE, 1.1

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Wed Feb 14 04:02:35 UTC 2007


Author: ikent

Update of /cvs/dist/rpms/autofs/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv9420

Added Files:
	autofs-5.0.1-rc3-do_mkdir-return-status.patch 
Log Message:
- add patch for previous commit even.


autofs-5.0.1-rc3-do_mkdir-return-status.patch:
 CHANGELOG          |    1 +
 daemon/automount.c |   14 +++++---------
 2 files changed, 6 insertions(+), 9 deletions(-)

--- NEW FILE autofs-5.0.1-rc3-do_mkdir-return-status.patch ---
diff --git a/CHANGELOG b/CHANGELOG
index bdedbf5..cdf8ed2 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -9,6 +9,7 @@
 - fix handling of trailing white space in wildcard lookup.
 - check fqdn of each interface when matching export access list.
 - fix race when setting task done.
+- correct return status from do_mkdir.
 
 4/1/2007 autofs-5.0.1 rc3
 -------------------------
diff --git a/daemon/automount.c b/daemon/automount.c
index ae61f02..368153a 100644
--- a/daemon/automount.c
+++ b/daemon/automount.c
@@ -81,27 +81,23 @@ static int do_mkdir(const char *parent, const char *path, mode_t mode)
 	/* If path exists we're done */
 	status = stat(path, &st);
 	if (status == 0) {
-		if (!S_ISDIR(st.st_mode)) {
+		if (!S_ISDIR(st.st_mode))
 			errno = ENOTDIR;
-			return 0;
-		}
-		return 1;
+		errno = EEXIST;
+		return 0;
 	}
 
 	/*
 	 * If we're trying to create a directory within an autofs fs
-	 * of the path is contained in a localy mounted fs go ahead.
+	 * or the path is contained in a localy mounted fs go ahead.
 	 */
 	status = -1;
 	if (*parent)
 		status = statfs(parent, &fs);
 	if ((status != -1 && fs.f_type == AUTOFS_SUPER_MAGIC) ||
 	    contained_in_local_fs(path)) {
-		if (mkdir(path, mode) == -1) {
-			if (errno == EEXIST)
-				return 1;
+		if (mkdir(path, mode) == -1)
 			return 0;
-		}
 		return 1;
 	}
 




More information about the fedora-cvs-commits mailing list