- long tmp;
-
- fp->maxfd = 0;
- while ((de = readdir (d)) != NULL)
- {
- /* Count open file descriptors (actually find highest
- numbered). */
- tmp = strtol (&de->d_name[0], NULL, 10);
- if (fp->maxfd < tmp)
- fp->maxfd = tmp;
- }
- /* Allocate array of file positions. */
- fp->filepos = XRESIZEVEC (off_t, fp->filepos, fp->maxfd + 1);
-
- /* Initialize to -1 (invalid). */
- for (tmp = 0; tmp <= fp->maxfd; tmp++)
- fp->filepos[tmp] = -1;
-
- /* Now find actual file positions. */
- rewinddir (d);
- while ((de = readdir (d)) != NULL)
- if (isdigit (de->d_name[0]))
- {
- tmp = strtol (&de->d_name[0], NULL, 10);
- fp->filepos[tmp] = call_lseek (tmp, 0, SEEK_CUR);
- }
- closedir (d);
+ /* Count open file descriptors (actually find highest
+ numbered). */
+ tmp = strtol (&de->d_name[0], NULL, 10);
+ if (fp->maxfd < tmp)
+ fp->maxfd = tmp;