Date: Wed, 2 Apr 1997 18:38:16 +0300 (IDT) From: Eli Zaretskii To: djgpp-workers AT delorie DOT com Subject: _rename patch Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII The last patch to RCS was triggered by some wierd network redirector which returns error code 2 (file doesn't exist) when you try to rename a file on a networked drive and the target of the rename already exists (we expect DOS to return code 5: access denied). The following patch to `_rename' fixes that problem and makes the patch to RCS unnecessary: *** src/libc/ansi/stdio/_rename.c~0 Sun Oct 27 19:36:54 1996 --- src/libc/ansi/stdio/_rename.c Sun Mar 30 13:35:34 1997 *************** *** 1,7 **** --- 1,9 ---- + /* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ #include #include #include + #include #include #include #include *************** int _rename(const char *old, const char *** 85,91 **** __dpmi_int(0x21, &r); if(r.x.flags & 1) { ! if (r.x.ax == 5 && i == 0) /* access denied */ remove(new); /* and try again */ else { --- 87,94 ---- __dpmi_int(0x21, &r); if(r.x.flags & 1) { ! if (i == 0 ! && (r.x.ax == 5 || (r.x.ax == 2 && __file_exists(old)))) remove(new); /* and try again */ else {