From 6661bdcd7d37b6979c07726f748fe1c39b546e8a Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 29 Jan 2003 18:06:54 +0000 Subject: [PATCH] Fix read()/write() ssize_t problem git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@329 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/autoconf/configure.in | 1 + bacula/src/stored/block.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index dc35507242..d672c88fb2 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -1335,6 +1335,7 @@ AC_OUTPUT([autoconf/Make.common \ scripts/bacula \ scripts/fd \ scripts/Makefile \ + scripts/logrotate \ doc/Makefile \ src/Makefile \ src/console/Makefile \ diff --git a/bacula/src/stored/block.c b/bacula/src/stored/block.c index 43b349ee0f..65acac6ea0 100644 --- a/bacula/src/stored/block.c +++ b/bacula/src/stored/block.c @@ -290,7 +290,7 @@ int write_block_to_device(JCR *jcr, DEVICE *dev, DEV_BLOCK *block) */ int write_block_to_dev(JCR *jcr, DEVICE *dev, DEV_BLOCK *block) { - size_t stat = 0; + ssize_t stat = 0; uint32_t wlen; /* length to write */ int hit_max1, hit_max2; int ok; @@ -364,7 +364,7 @@ int write_block_to_dev(JCR *jcr, DEVICE *dev, DEV_BLOCK *block) dev->VolCatInfo.VolCatWrites++; Dmsg1(500, "Write block of %u bytes\n", wlen); - if ((uint32_t) (stat=write(dev->fd, block->buf, (size_t)wlen)) != wlen) { + if ((uint32_t)(stat=write(dev->fd, block->buf, (size_t)wlen)) != wlen) { /* We should check for errno == ENOSPC, BUT many * devices simply report EIO when it is full. * with a little more thought we may be able to check @@ -474,7 +474,7 @@ int read_block_from_device(DEVICE *dev, DEV_BLOCK *block) */ int read_block_from_dev(DEVICE *dev, DEV_BLOCK *block) { - size_t stat; + ssize_t stat; int looping; looping = 0; -- 2.39.5