+ {
+ int fd = st->fd;
+ void (*diag) (char const *) = 0;
+ struct tar_stat_info stsub;
+ tar_stat_init (&stsub);
+
+ if (fd < 0)
+ {
+ errno = - fd;
+ diag = open_diag;
+ }
+ else if (fstatat (fd, entry + 1, &stsub.stat,
+ fstatat_flags) != 0)
+ diag = stat_diag;
+ else if (S_ISDIR (stsub.stat.st_mode))
+ {
+ int subfd = subfile_open (st, entry + 1,
+ open_read_flags);
+ if (subfd < 0)
+ diag = open_diag;
+ else
+ {
+ stsub.fd = subfd;
+ if (fstat (subfd, &stsub.stat) != 0)
+ diag = stat_diag;
+ }
+ }
+
+ if (diag)
+ {
+ file_removed_diag (full_name, false, diag);
+ *entry = 'N';
+ }
+ else if (S_ISDIR (stsub.stat.st_mode))
+ {
+ int pd_flag = 0;
+ if (!recursion_option)
+ pd_flag |= PD_FORCE_CHILDREN | NO_CHILDREN;
+ else if (directory->children == ALL_CHILDREN)
+ pd_flag |= PD_FORCE_CHILDREN | ALL_CHILDREN;
+ *entry = 'D';
+
+ stsub.parent = st;
+ procdir (full_name, &stsub, pd_flag, entry);
+ restore_parent_fd (&stsub);
+ }
+ else if (one_file_system_option &&
+ device != stsub.stat.st_dev)
+ *entry = 'N';
+ else if (*entry == 'Y')
+ /* New entry, skip further checks */;
+ /* FIXME: if (S_ISHIDDEN (stat_data.st_mode))?? */
+ else if (OLDER_STAT_TIME (stsub.stat, m)
+ && (!after_date_option
+ || OLDER_STAT_TIME (stsub.stat, c)))
+ *entry = 'N';
+ else
+ *entry = 'Y';
+
+ tar_stat_destroy (&stsub);
+ }