]> git.wh0rd.org - dump.git/blobdiff - dump/tape.c
Don't include linux/fs.h since it will break compilation in some cases.
[dump.git] / dump / tape.c
index 5fa739c01302ee9d8481fb8e7b3f83fdd0d47743..39d8b4caae4023890c9be13f6604ac8faf851391 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: tape.c,v 1.62 2002/01/25 15:08:59 stelian Exp $";
+       "$Id: tape.c,v 1.65 2002/03/11 10:17:43 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -71,9 +71,6 @@ int    write(), read();
 #include <sys/wait.h>
 #include <sys/mtio.h>
 #ifdef __linux__
-#include <linux/fs.h>
-#undef atomic_read     /* this get wrongly defined in kernel */
-                       /* headers and we don't want it */
 #ifdef HAVE_EXT2FS_EXT2_FS_H
 #include <ext2fs/ext2_fs.h>
 #else
@@ -1234,18 +1231,23 @@ doslave(int cmd, int slave_number, int first)
 #ifdef USE_QFA
                if (gTapeposfd >= 0) {
                        int i;
+                       int firstpass = 1;
                        for (i = 0; i < ntrec; ++i) {
                                uspclptr = (union u_spcl *)&slp->tblock[i];
                                spclptr = &uspclptr->s_spcl;
                                if ((spclptr->c_magic == NFS_MAGIC) && 
                                    (spclptr->c_type == TS_INODE) &&
+                                   ((spclptr->c_dinode.di_mode & S_IFMT) != IFDIR) &&
                                    (spclptr->c_date == gThisDumpDate)) {
                                        /* if an error occured previously don't
                                         * try again */
-                                       if (gtperr == 0) {
-                                               if ((gtperr = GetTapePos(&curtapepos)) == 0)
-                                                       MkTapeString(spclptr, curtapepos);
+                                       if (firstpass) {
+                                               firstpass = 0;
+                                               if (gtperr == 0) 
+                                                       gtperr = GetTapePos(&curtapepos);
                                        }
+                                       if (gtperr == 0)
+                                                       MkTapeString(spclptr, curtapepos);
                                }
                        }
                }