]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Map size_t/ssize_t read()/write() type to full_read()/full_write() in fd_common
authorEric Bollengier <eric@baculasystems.com>
Thu, 5 Aug 2021 07:35:19 +0000 (09:35 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:03 +0000 (09:03 +0100)
bacula/src/plugins/fd/fd_common.h

index 3d5517def29b3c11d5c8c0501d3f8c9e5383c00a..9ed3e5bb4cdbb80f435402c2c818c2e7e853d381 100644 (file)
@@ -803,8 +803,9 @@ cleanup:
 /* Handle signal when reading from a pipe, functions based on
  * fread doesn't work very well.
  */
-static int32_t full_read(int in, char *buf, int32_t nbytes)  {
-   ssize_t  nleft, nread;
+static int32_t full_read(int in, char *buf, uint32_t nbytes)  {
+   size_t  nleft;
+   ssize_t nread;
    nleft = nbytes;
 
    while (nleft > 0) {
@@ -831,10 +832,12 @@ static int32_t full_read(int in, char *buf, int32_t nbytes)  {
 #endif
 
 #ifdef USE_FULL_WRITE
-static int32_t full_write(int fd, const char *ptr, int32_t nbytes, bool *canceled=NULL)
+static int32_t full_write(int fd, const char *ptr, uint32_t nbytes, bool *canceled=NULL)
 {
-   ssize_t nleft, nwritten;
+   size_t nleft;
+   ssize_t nwritten;
    nleft = nbytes;
+
    while (nleft > 0 && (canceled == NULL || *canceled == false)) {
       do {
          errno = 0;