Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Feb 2002 05:27:51 -0800
From:      Alfred Perlstein <bright@mu.org>
To:        fs@freebsd.org
Subject:   mkdir / == odd
Message-ID:  <20020218132751.GX12136@elvis.mu.org>

next in thread | raw e-mail | index | archive | help
# mkdir /
mkdir: /: Is a directory

shouldn't mkdir get a EEXIST error back?

this patch to mkdir also fixes it.


Index: mkdir.c
===================================================================
RCS file: /home/ncvs/src/bin/mkdir/mkdir.c,v
retrieving revision 1.23
diff -u -r1.23 mkdir.c
--- mkdir.c	5 Feb 2002 21:55:12 -0000	1.23
+++ mkdir.c	18 Feb 2002 13:28:06 -0000
@@ -143,7 +143,7 @@
 	p = path;
 	oumask = 0;
 	retval = 0;
-	if (p[0] == '/')		/* Skip leading '/'. */
+	while (p[0] == '/')		/* Skip leading '/'. */
 		++p;
 	for (first = 1, last = 0; !last ; ++p) {
 		if (p[0] == '\0')

-- 
-Alfred Perlstein [alfred@freebsd.org]
'Instead of asking why a piece of software is using "1970s technology,"
 start asking why software is ignoring 30 years of accumulated wisdom.'
Tax deductible donations for FreeBSD: http://www.freebsdfoundation.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-fs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020218132751.GX12136>