From mi@aldan.algebra.com  Fri Feb 12 07:29:18 2010
Return-Path: <mi@aldan.algebra.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D3938106566C
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 12 Feb 2010 07:29:18 +0000 (UTC)
	(envelope-from mi@aldan.algebra.com)
Received: from aldan.algebra.com (pool-173-70-194-135.nwrknj.fios.verizon.net [173.70.194.135])
	by mx1.freebsd.org (Postfix) with ESMTP id 928928FC14
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 12 Feb 2010 07:29:18 +0000 (UTC)
Received: from aldan.algebra.com (localhost [127.0.0.1])
	by aldan.algebra.com (8.14.3/8.14.3) with ESMTP id o1C79Xeu080186
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 12 Feb 2010 02:09:33 -0500 (EST)
	(envelope-from mi@aldan.algebra.com)
Received: (from mi@localhost)
	by aldan.algebra.com (8.14.3/8.14.3/Submit) id o1C79WHj080185;
	Fri, 12 Feb 2010 02:09:32 -0500 (EST)
	(envelope-from mi)
Message-Id: <201002120709.o1C79WHj080185@aldan.algebra.com>
Date: Fri, 12 Feb 2010 02:09:32 -0500 (EST)
From: "Mikhail T." <mi@aldan.algebra.com>
Reply-To: "Mikhail T." <mi@aldan.algebra.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: mkdir(2) may set errno incorrectly
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         143834
>Category:       kern
>Synopsis:       [libc] mkdir(2) may set errno incorrectly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 12 07:30:01 UTC 2010
>Closed-Date:    Fri Feb 12 14:45:31 UTC 2010
>Last-Modified:  Fri Feb 12 14:45:31 UTC 2010
>Originator:     Mikhail T.
>Release:        FreeBSD 7.2-STABLE amd64
>Organization:
Virtual Estates, Inc. ( http://sybpipe.com/ )
>Environment:
System: FreeBSD aldan.algebra.com 7.2-STABLE FreeBSD 7.2-STABLE #3: Sun Dec 20 20:10:12 EST 2009 mi@aldan.algebra.com:/meow/obj/var/src/sys/SILVER-SMP amd64

>Description:
	When the directory to be created is "/", mkdir(2) will set errno
	to EISDIR instead of EEXISTS.

>How-To-Repeat:

	Compile and run this program:

		#include <err.h>
		#include <stdio.h>
		#include <sys/stat.h>

		int
		main(int argc, char *argv[])
		{
			mkdir("/", 0666);

			warn("mkdir /");

			mkdir("/tmp", 0666);

			warn("mkdir /tmp");

			return 0;
		}

	You'll see the following inconsistency:

		t: mkdir /: Is a directory
		t: mkdir /tmp: File exists

	It should be "File exists" for both...
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: jh 
State-Changed-When: Fri Feb 12 14:45:30 UTC 2010 
State-Changed-Why:  
Duplicate of kern/59739. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=143834 
>Unformatted:
