From: Martin Str|mberg Message-Id: <199803210148.CAA15751@sister.ludd.luth.se> Subject: Re: mkdir and errno To: dj AT delorie DOT com Date: Sat, 21 Mar 1998 02:48:25 +0100 (MET) Cc: djgpp-workers AT delorie DOT com Reply-To: martin DOT stromberg AT lu DOT erisoft DOT se (Martin Strömberg) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk Indeed. New try follows. The reason I do like I do, is to make it easier to add further errno improvments later (hint-hint, nudge). Sigh, MartinS *** libc/posix/sys/stat/mkdir.c.org Sat Mar 21 02:02:35 1998 --- libc/posix/sys/stat/mkdir.c Sat Mar 21 02:33:54 1998 *************** *** 32,38 **** --- 32,43 ---- /* see if the directory existed, in which case we should return EEXIST - DJ */ if (access(dirname, D_OK) == 0) + { errno = EEXIST; + return(-1); + } + /* Restore errno. */ + errno = EACCES; } return -1; }