Changeset 2561


Ignore:
Timestamp:
Mar 6, 2006, 11:59:50 PM (19 years ago)
Author:
bird
Message:

rewinddir is broken in EMX, avoid it and do close/opendir instead.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/coreutils/src/remove.c

    r2554 r2561  
    6060enum
    6161  {
     62#ifdef __EMX__
     63    CONSECUTIVE_READDIR_UNLINK_THRESHOLD = 1024*1024*1024
     64#else
    6265    CONSECUTIVE_READDIR_UNLINK_THRESHOLD = 200
     66#endif
    6367  };
    6468
     
    864868  enum RM_status status = top->status;
    865869  size_t n_unlinked_since_opendir_or_last_rewind = 0;
     870#ifdef __EMX__
     871  char curdir[PATH_MAX];
     872  if (!getcwd(curdir, sizeof(curdir)))
     873      strcpy(curdir, ".");
     874#endif
    866875
    867876  assert (VALID_STATUS (status));
     
    906915                 (since the opendir or the previous rewinddir) that this
    907916                 NULL-return may be the symptom of a buggy readdir.  */
     917#ifdef __EMX__
     918              closedir (dirp);
     919              dirp = opendir (curdir);
     920              if (!dirp)
     921                break;
     922#else
    908923              rewinddir (dirp);
     924#endif
    909925              n_unlinked_since_opendir_or_last_rewind = 0;
    910926              continue;
Note: See TracChangeset for help on using the changeset viewer.