- accumulator = new_accumulator ();
-
- if (dirp && children != NO_CHILDREN)
- for (entry = dirp;
- (entrylen = strlen (entry)) != 0;
- entry += entrylen + 1)
- {
- if (name_buffer_size <= entrylen + name_length)
- {
- do
- name_buffer_size += NAME_FIELD_SIZE;
- while (name_buffer_size <= entrylen + name_length);
- name_buffer = xrealloc (name_buffer, name_buffer_size + 2);
- }
- strcpy (name_buffer + name_length, entry);
-
- if (excluded_name (name_buffer))
- add_to_accumulator (accumulator, "N", 1);
- else
- {
- struct stat stat_data;
-
- if (deref_stat (dereference_option, name_buffer, &stat_data))
- {
- if (ignore_failed_read_option)
- stat_warn (name_buffer);
- else
- stat_error (name_buffer);
- continue;
- }
-
- if (S_ISDIR (stat_data.st_mode))
- {
- bool nfs = NFS_FILE_STAT (stat_data);
-
- if (directory = find_directory (name_buffer), directory)
- {
- /* With NFS, the same file can have two different devices
- if an NFS directory is mounted in multiple locations,
- which is relatively common when automounting.
- To avoid spurious incremental redumping of
- directories, consider all NFS devices as equal,
- relying on the i-node to establish differences. */
-
- if (! (((directory->nfs & nfs)
- || directory->device_number == stat_data.st_dev)
- && directory->inode_number == stat_data.st_ino))
- {
- if (verbose_option)
- WARN ((0, 0, _("%s: Directory has been renamed"),
- quotearg_colon (name_buffer)));
- directory->children = ALL_CHILDREN;
- directory->nfs = nfs;
- directory->device_number = stat_data.st_dev;
- directory->inode_number = stat_data.st_ino;
- }
- directory->found = 1;
- }
- else
- {
- if (verbose_option)
- WARN ((0, 0, _("%s: Directory is new"),
- quotearg_colon (name_buffer)));
- directory = note_directory (name_buffer,
- stat_data.st_dev,
- stat_data.st_ino, nfs, 1);
- directory->children =
- ((listed_incremental_option
- || newer_mtime_option <= stat_data.st_mtime
- || (after_date_option &&
- newer_ctime_option <= stat_data.st_ctime))
- ? ALL_CHILDREN
- : CHANGED_CHILDREN);
- }
-
- if (one_file_system_option && device != stat_data.st_dev)
- directory->children = NO_CHILDREN;
- else if (children == ALL_CHILDREN)
- directory->children = ALL_CHILDREN;
-
- add_to_accumulator (accumulator, "D", 1);
- }
-
- else if (one_file_system_option && device != stat_data.st_dev)
- add_to_accumulator (accumulator, "N", 1);