+
+ /* Don't try to mmap subdirectories. Skip them, return success. */
+ ret = fstat(fd, &statbuf);
+ if (ret) {
+ perror("File stream fstat()");
+ goto fstat_error;
+ }
+ if (S_ISDIR(statbuf.st_mode)) {
+ fprintf(stderr, "[warning] Skipping directory '%s' found in trace\n", path);
+ ret = 0;
+ goto fd_is_dir_ok;
+ }
+