]> git.wh0rd.org - dump.git/commitdiff
Fixed compare of dumped socket files by ignoring them.
authorStelian Pop <stelian@popies.net>
Tue, 11 Feb 2003 09:56:46 +0000 (09:56 +0000)
committerStelian Pop <stelian@popies.net>
Tue, 11 Feb 2003 09:56:46 +0000 (09:56 +0000)
CHANGES
restore/tape.c

diff --git a/CHANGES b/CHANGES
index 906deb4e0c4a360d74aba67b506b5574aef9e3af..dee04080fb6181af6fe865cdef67d5e21a63a9bc 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.213 2003/02/11 09:26:34 stelian Exp $
+$Id: CHANGES,v 1.214 2003/02/11 09:56:46 stelian Exp $
 
 Changes between versions 0.4b33 and 0.4b34 (released ?????????????????)
 =======================================================================
@@ -12,6 +12,10 @@ Changes between versions 0.4b33 and 0.4b34 (released ?????????????????)
        with old build environments. Thanks to Kari Lempiainen 
        <kari@funky.pp.fi> for reporting the bug.
 
+3.     Fixed restore to correctly ignore sockets when comparing
+       a dump (as socket cannot be properly restored anyway). Thanks
+       to <gunther@mit.edu> for reporting the bug.
+
 Changes between versions 0.4b32 and 0.4b33 (released February 10, 2003)
 =======================================================================
 
index 2bb447239bed286d20afbe0de2cb57f2afdf7215..145f769b949308e38e343a60bd7bbaf4f2e7c098 100644 (file)
@@ -46,7 +46,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: tape.c,v 1.67 2003/01/10 14:42:51 stelian Exp $";
+       "$Id: tape.c,v 1.68 2003/02/11 09:56:48 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -1266,6 +1266,16 @@ comparefile(char *name)
        struct STAT stemp;
 #endif
 
+       curfile.name = name;
+       curfile.action = USING;
+       mode = curfile.dip->di_mode;
+
+       if ((mode & IFMT) == IFSOCK) {
+               Vprintf(stdout, "skipped socket %s\n", name);
+               skipfile();
+               return;
+       }
+
        if ((r = LSTAT(name, &sb)) != 0) {
                warn("%s: does not exist (%d)", name, r);
                do_compare_error;
@@ -1273,10 +1283,6 @@ comparefile(char *name)
                return;
        }
 
-       curfile.name = name;
-       curfile.action = USING;
-       mode = curfile.dip->di_mode;
-
        Vprintf(stdout, "comparing %s (size: %ld, mode: 0%o)\n", name,
                (long)sb.st_size, mode);