]> Dogcows Code - chaz/tar/blobdiff - src/create.c
(decode_options): Set newer_time_option to TYPE_MINIMUM, so that
[chaz/tar] / src / create.c
index ebc0442d19363c4407ecf12898f6b582cab9b8b4..a7d134495caba826d63b15dd5d82d8ee42183b87 100644 (file)
@@ -327,7 +327,7 @@ Removing leading `/' from absolute path names in the archive")));
   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)
@@ -540,7 +540,7 @@ deal_with_sparse (char *name, union block *header)
   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.  */
@@ -659,7 +659,7 @@ finish_sparse_file (int file, off_t *sizeleft, off_t fullsize, char *name)
 #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;
@@ -670,7 +670,7 @@ finish_sparse_file (int file, off_t *sizeleft, off_t fullsize, char *name)
 #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];
@@ -691,7 +691,7 @@ Read error at byte %s, reading %lu bytes, in file %s"),
        char buffer[BLOCKSIZE];
 
        clear_buffer (buffer);
-       count = full_read (file, buffer, bufsize);
+       count = safe_read (file, buffer, bufsize);
        memcpy (start->buffer, buffer, BLOCKSIZE);
       }
 
@@ -755,7 +755,8 @@ create_archive (void)
       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)
@@ -780,7 +781,8 @@ create_archive (void)
   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 ();
@@ -1197,7 +1199,7 @@ Removing leading `/' from absolute links")));
            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];
@@ -1478,9 +1480,10 @@ Read error at byte %s, reading %lu bytes, in file %s"),
 
       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)
@@ -1495,8 +1498,6 @@ Read error at byte %s, reading %lu bytes, in file %s"),
 #endif
            }
          strcpy (namebuf + len, entry->d_name);
-         if (exclude_option && check_exclude (namebuf))
-           continue;
          dump_file (namebuf, our_device, 0);
        }
 
@@ -1517,9 +1518,7 @@ Read error at byte %s, reading %lu bytes, in file %s"),
     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
@@ -1545,7 +1544,7 @@ Read error at byte %s, reading %lu bytes, in file %s"),
 
   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);
This page took 0.025164 seconds and 4 git commands to generate.