Changeset 3905 for branches/libc-0.6/src


Ignore:
Timestamp:
Oct 24, 2014, 12:35:09 AM (11 years ago)
Author:
bird
Message:

trunk,0.6: b_fsRename.c: Overwrite read-only target files to be more unix compatible. Fixes #288.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/libc-0.6/src/emx/src/lib/sys/b_fsRename.c

    r2254 r3905  
    156156                                     * to retry the move operation and handle races with other
    157157                                     * processes somewhat ok...
     158                                     *
     159                                     * Try clear the read-only attribute on files before deleting them.
     160                                     * Directories cannot have read-only attributes on OS/2 it seems.
    158161                                     */
    159162                                    if (fsts3New.attrFile & FILE_DIRECTORY)
     
    163166                                        if (!rc2)
    164167                                            continue;
    165                                         else if (rc2 == ERROR_ACCESS_DENIED)
     168                                        if (rc2 == ERROR_ACCESS_DENIED)
    166169                                            rc = -ENOTEMPTY;
    167170                                        else
     
    170173                                    else
    171174                                    {
     175                                        if (fsts3New.attrFile & FILE_READONLY)
     176                                        {
     177                                            fsts3New.attrFile &= ~FILE_READONLY;
     178                                            rc2 = DosSetPathInfo((PCSZ)&szNativePathNew[0], FIL_STANDARD, &fsts3New,
     179                                                                 sizeof(fsts3New), 0 /*fOptions*/);
     180                                            LIBCLOG_MSG("DosSetPathInfo('%s',read-write) -> %d\n", szNativePathNew, rc2);
     181                                        }
     182
    172183                                        rc2 = DosDelete((PCSZ)&szNativePathNew[0]);
    173184                                        LIBCLOG_MSG("DosDelete('%s') -> %d\n", szNativePathNew, rc2);
    174185                                        if (!rc2)
    175186                                            continue;
    176                                         else
    177                                             rc = -__libc_native2errno(rc2);
     187                                        rc = -__libc_native2errno(rc2);
    178188                                    }
    179189                                }
Note: See TracChangeset for help on using the changeset viewer.