]> git.wh0rd.org - dump.git/blobdiff - dump/traverse.c
-A archive file implementation
[dump.git] / dump / traverse.c
index ffcac8842cab2c9f4560ef7a5ccf845db26263ba..80d7e86bf17e18441bb28cf38ac708f59d5d516b 100644 (file)
@@ -2,8 +2,8 @@
  *     Ported to Linux's Second Extended File System as part of the
  *     dump and restore backup suit
  *     Remy Card <card@Linux.EU.Org>, 1994-1997
- *     Stelian Pop <pop@noos.fr>, 1999-2000
- *     Stelian Pop <pop@noos.fr> - Alcôve <www.alcove.fr>, 2000
+ *     Stelian Pop <stelian@popies.net>, 1999-2000
+ *     Stelian Pop <stelian@popies.net> - Alcôve <www.alcove.com>, 2000-2002
  */
 
 /*-
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: traverse.c,v 1.39 2001/11/11 00:06:39 stelian Exp $";
+       "$Id: traverse.c,v 1.41 2002/01/25 14:59:53 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -1176,21 +1176,20 @@ dumpmap(char *map, int type, dump_ino_t ino)
                writerec(cp, 0);
 }
 
-/*
- * Write a header record to the dump tape.
- */
 #if defined __linux__ && !defined(int32_t)
 #define int32_t __s32
 #endif
+
+/* 
+ * Compute and fill in checksum information.
+ */
 void
-writeheader(dump_ino_t ino)
+mkchecksum(union u_spcl *tmpspcl) 
 {
-       register int32_t sum, cnt, *lp;
+       int32_t sum, cnt, *lp;
 
-       spcl.c_inumber = ino;
-       spcl.c_magic = NFS_MAGIC;
-       spcl.c_checksum = 0;
-       lp = (int32_t *)&spcl;
+       tmpspcl->s_spcl.c_checksum = 0;
+       lp = (int32_t *)&tmpspcl->s_spcl;
        sum = 0;
        cnt = sizeof(union u_spcl) / (4 * sizeof(int32_t));
        while (--cnt >= 0) {
@@ -1199,7 +1198,18 @@ writeheader(dump_ino_t ino)
                sum += *lp++;
                sum += *lp++;
        }
-       spcl.c_checksum = CHECKSUM - sum;
+       tmpspcl->s_spcl.c_checksum = CHECKSUM - sum;
+}
+
+/*
+ * Write a header record to the dump tape.
+ */
+void
+writeheader(dump_ino_t ino)
+{
+       spcl.c_inumber = ino;
+       spcl.c_magic = NFS_MAGIC;
+       mkchecksum((union u_spcl *)&spcl);
        writerec((char *)&spcl, 1);
 }