From b48a4d47eef5e3d4252072a8cac84e6f6ef499ba Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Sat, 20 Nov 2010 18:56:03 +0100 Subject: [PATCH] Fix delta-test-fd --- bacula/src/plugins/fd/delta-test-fd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bacula/src/plugins/fd/delta-test-fd.c b/bacula/src/plugins/fd/delta-test-fd.c index 1753dac363..ce58587eca 100644 --- a/bacula/src/plugins/fd/delta-test-fd.c +++ b/bacula/src/plugins/fd/delta-test-fd.c @@ -348,7 +348,7 @@ static bRC pluginIO(bpContext *ctx, struct io_pkt *io) case IO_OPEN: Dmsg(ctx, dbglvl, "delta-fd: IO_OPEN\n"); if (io->flags & (O_CREAT | O_WRONLY)) { - self->fd = fopen(self->fname, "w+"); + self->fd = fopen(self->fname, "a+"); if (!self->fd) { io->io_errno = errno; Jmsg(ctx, M_FATAL, 0, @@ -379,6 +379,7 @@ static bRC pluginIO(bpContext *ctx, struct io_pkt *io) io->offset = self->delta * 100; fseek(self->fd, io->offset, SEEK_SET); io->status = fread(io->buf, 1, 100, self->fd); + Dmsg(ctx, dbglvl, "delta-fd: READ offset=%lld\n", (int64_t)io->offset); self->done = true; } if (io->status == 0 && ferror(self->fd)) { @@ -396,8 +397,8 @@ static bRC pluginIO(bpContext *ctx, struct io_pkt *io) Jmsg(ctx, M_FATAL, 0, "Logic error: NULL write FD\n"); return bRC_Error; } + Dmsg(ctx, dbglvl, "delta-fd: WRITE count=%lld\n", (int64_t)io->count); io->status = fwrite(io->buf, 1, io->count, self->fd); - if (io->status == 0 && ferror(self->fd)) { Jmsg(ctx, M_FATAL, 0, "Pipe write error\n"); @@ -420,7 +421,7 @@ static bRC pluginIO(bpContext *ctx, struct io_pkt *io) Jmsg(ctx, M_FATAL, 0, "Logic error: NULL FD on delta close\n"); return bRC_Error; } - Dmsg(ctx, dbglvl, "delta-fd: seek offset=%lld\n", (int64_t)io->offset); + Dmsg(ctx, dbglvl, "delta-fd: SEEK offset=%lld\n", (int64_t)io->offset); io->status = fseek(self->fd, io->offset, io->whence); break; } -- 2.39.5