if (group_option != (gid_t) -1)
st->st_gid = group_option;
if (mode_option)
- st->st_mode = ((st->st_mode & S_IFMT)
+ st->st_mode = ((st->st_mode & ~MODE_ALL)
| mode_adjust (st->st_mode, mode_option));
/* Paul Eggert tried the trivial test ($WRITER cf a b; $READER tvf a)
init_sparsearray ();
clear_buffer (buffer);
- while (count = full_read (file, buffer, sizeof buffer), count != 0)
+ while (count = safe_read (file, buffer, sizeof buffer), count != 0)
{
/* Realloc the scratch area as necessary. FIXME: should reallocate
only at beginning of a new instance of non-zero data. */
#if 0
if (amount_read)
{
- count = full_read (file, start->buffer + amount_read,
+ count = safe_read (file, start->buffer + amount_read,
BLOCKSIZE - amount_read);
bufsize -= BLOCKSIZE - amount_read;
amount_read = 0;
#endif
/* Store the data. */
- count = full_read (file, start->buffer, BLOCKSIZE);
+ count = safe_read (file, start->buffer, BLOCKSIZE);
if (count < 0)
{
char buf[UINTMAX_STRSIZE_BOUND];
char buffer[BLOCKSIZE];
clear_buffer (buffer);
- count = full_read (file, buffer, bufsize);
+ count = safe_read (file, buffer, bufsize);
memcpy (start->buffer, buffer, BLOCKSIZE);
}
collect_and_sort_names ();
while (p = name_from_list (), p)
- dump_file (p, (dev_t) -1, 1);
+ if (!excluded_pathname (excluded, p))
+ dump_file (p, (dev_t) -1, 1);
blank_name_list ();
while (p = name_from_list (), p)
else
{
while (p = name_next (1), p)
- dump_file (p, (dev_t) -1, 1);
+ if (!excluded_pathname (excluded, p))
+ dump_file (p, (dev_t) -1, 1);
}
write_eot ();
if (f < 0)
count = bufsize;
else
- count = full_read (f, start->buffer, bufsize);
+ count = safe_read (f, start->buffer, bufsize);
if (count < 0)
{
char buf[UINTMAX_STRSIZE_BOUND];
while (entry = readdir (directory), entry)
{
- /* Skip `.' and `..'. */
+ /* Skip `.', `..', and excluded file names. */
- if (is_dot_or_dotdot (entry->d_name))
+ if (is_dot_or_dotdot (entry->d_name)
+ || excluded_filename (excluded, entry->d_name))
continue;
if ((int) NAMLEN (entry) + len >= buflen)
#endif
}
strcpy (namebuf + len, entry->d_name);
- if (exclude_option && check_exclude (namebuf))
- continue;
dump_file (namebuf, our_device, 0);
}
type = BLKTYPE;
#endif
- /* Avoid screwy apollo lossage where S_IFIFO == S_IFSOCK. */
-
-#if (_ISP__M68K == 0) && (_ISP__A88K == 0) && defined(S_ISFIFO)
+#ifdef S_ISFIFO
else if (S_ISFIFO (current_stat.st_mode))
type = FIFOTYPE;
#endif
header->header.typeflag = type;
-#if defined(S_IFBLK) || defined(S_IFCHR)
+#if defined S_ISBLK || defined S_ISCHR
if (type != FIFOTYPE)
{
MAJOR_TO_OCT (major (current_stat.st_rdev), header->header.devmajor);