Changeset 1312 for trunk/dll


Ignore:
Timestamp:
Dec 3, 2008, 1:47:37 AM (17 years ago)
Author:
Gregg Young
Message:

Fix for traps caused by race condition on directory deletes. This disables immediate updates for deleted directory and set a semaphore to allow the delete to complete before update. It also quotes the * on the extract command line which appears to allow tar 1.15 and higher to work. (Ticket 304)

Location:
trunk/dll
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/init.c

    r1306 r1312  
    158158
    159159#pragma data_seg(GLOBAL1)
     160HMTX hmtxDeleteDir;
    160161HMTX hmtxFM2Globals;
    161162ULONG OS2ver[2];
     
    11811182                   sizeof(PVOID));
    11821183
    1183   DosCreateMutexSem("\\SEM\\GLOBAL1", &hmtxFM2Globals, 0L, FALSE);
    1184 
     1184  if (DosCreateMutexSem("\\SEM\\GLOBAL1", &hmtxFM2Globals, 0L, FALSE))
     1185    Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
     1186              "DosCreateMutexSem");
     1187  if (DosCreateMutexSem("\\SEM\\DELETDIR", &hmtxDeleteDir, 0L, FALSE))
     1188    Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
     1189              "DosCreateMutexSem");
    11851190  /*
    11861191   * set some defaults (note: everything else automatically initialized
  • trunk/dll/init.h

    r1303 r1312  
    9292extern ULONGLONG ullTmpSpaceNeeded;
    9393extern HMTX hmtxFM2Globals;
     94extern HMTX hmtxDeleteDir;
    9495
    9596#endif // INIT_H
  • trunk/dll/worker.c

    r1275 r1312  
    481481                               ex.arcname,
    482482                               maskspaces ? "\"" : NullStr,
    483                                *ex.masks ? ex.masks : "*",
     483                               *ex.masks ? ex.masks : "\"*\"",
    484484                               maskspaces ? "\"" : NullStr) &&
    485485                      !stricmp(ex.extractdir, wk->directory)) {
     
    16041604                                 FIL_STANDARD,
    16051605                                 &fsa, (ULONG) sizeof(FILESTATUS3));
    1606                 if (fsa.attrFile & FILE_DIRECTORY) {
     1606                if (fsa.attrFile & FILE_DIRECTORY) {
     1607                  //priority_bumped();
     1608                  DosRequestMutexSem(hmtxDeleteDir, SEM_INDEFINITE_WAIT);
    16071609                  sprintf(prompt,
    16081610                          GetPString(IDS_DELETINGTEXT), wk->li->list[x]);
     
    16191621                    error = DosDeleteDir(wk->li->list[x]);
    16201622                  else
    1621                     DosDeleteDir(wk->li->list[x]);
     1623                    DosDeleteDir(wk->li->list[x]);
     1624                  DosReleaseMutexSem(hmtxDeleteDir);
     1625                  //priority_normal();
    16221626                }
    16231627                else {
     
    16951699                  AddNote(prompt);
    16961700                }
    1697                 if (fSyncUpdates ||
     1701                if ((fSyncUpdates  && !(fsa.attrFile & FILE_DIRECTORY)) ||
    16981702                    AddToList(wk->li->list[x], &files, &numfiles, &numalloc))
    16991703                  Broadcast(hab2,
Note: See TracChangeset for help on using the changeset viewer.