Date: Mon, 14 Jun 1999 17:56:05 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: pavenis AT lanet DOT lv cc: djgpp-workers AT delorie DOT com Subject: Re: Wrong errno value from rename() when sharing problems under Win9X In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 14 Jun 1999 pavenis AT lanet DOT lv wrote: > Rename returns invalid value in errno under Win95 when attempting > to rename already opened file (I got ENOENT, should be EACCES). Thanks for the report. Does the following fix the bug? Index: djgpp/src/libc/ansi/stdio/rename.c =================================================================== RCS file: /cvs/djgpp/djgpp/src/libc/ansi/stdio/rename.c,v retrieving revision 1.5 diff -c -r1.5 rename.c *** rename.c 1999/06/03 17:27:33 1.5 --- rename.c 1999/06/14 14:53:39 *************** *** 374,379 **** --- 374,385 ---- else if (errno) return -1; } + else if (target_attr == -1) + { + /* Target doesn't exist, and source is not a directory: + _rename() must be good enough. */ + simple_should_do = 1; + } /* On to some REAL work for a change. Let DOS do the simple job: moving a regular file, or renaming a directory. Note that on