- reg.fds = calloc(s->nr_files, sizeof(int));
- for (i = 0; i < s->nr_files; i++)
- reg.fds[i] = s->files[i].fd;
+ if (do_nop)
+ return 0;
+
+ s->fds = calloc(s->nr_files, sizeof(__s32));
+ for (i = 0; i < s->nr_files; i++) {
+ s->fds[i] = s->files[i].real_fd;
+ s->files[i].fixed_fd = i;
+ }
+ reg.fds = s->fds;