Mail Archives: djgpp-workers/1999/06/14/10:58:29
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
- Raw text -