#ifndef lint
static const char rcsid[] =
- "$Id: tape.c,v 1.54 2001/08/16 15:24:21 stelian Exp $";
+ "$Id: tape.c,v 1.58 2001/11/17 10:44:18 stelian Exp $";
#endif /* not lint */
#include <config.h>
#endif
#include <sys/param.h>
#include <sys/socket.h>
-#include <sys/time.h>
#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
void
rollforward(void)
{
- register struct req *p, *q, *prev;
+ register struct req *p, *q = NULL, *prev;
register struct slave *tslp;
int i, size, savedtapea, got;
union u_spcl *ntb, *otb;
union u_spcl *uspclptr;
struct s_spcl *spclptr;
#endif /* USE_QFA */
+ sigset_t set;
+
+ sigemptyset(&set);
+ sigaddset(&set, SIGUSR2);
+ sigprocmask(SIG_BLOCK, &set, NULL);
+ sigemptyset(&set);
/*
* Need our own seek pointer.
if ((diskfd = OPEN(disk, O_RDONLY)) < 0)
quit("slave couldn't reopen disk: %s\n", strerror(errno));
#ifdef __linux__
+#ifdef BLKFLSBUF
+ (void)ioctl(diskfd, BLKFLSBUF);
+#endif
ext2fs_close(fs);
retval = dump_fs_open(disk, &fs);
if (retval)
if (compressed && do_compress) {
comp_buf->length = bufsize;
worklen = TP_BSIZE + writesize;
+ compresult = 1;
#ifdef HAVE_ZLIB
if (!bzipflag) {
compresult = compress2(comp_buf->buf,
if (sigsetjmp(jmpbuf, 1) == 0) {
ready = 1;
if (!caught)
- (void) pause();
+ sigsuspend(&set);
}
ready = 0;
caught = 0;