]> git.wh0rd.org - dump.git/blobdiff - restore/tape.c
Fixed compare of dumped socket files by ignoring them.
[dump.git] / restore / tape.c
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);