Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 130701790bf2d95e902edf16031ff596 > files > 190

autofs-5.0.1-0.rc2.164.el5_8.src.rpm

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;
 	}