Update bytesRemain iff R/W operation.
authorjbj <devnull@localhost>
Tue, 8 Feb 2005 17:15:10 +0000 (17:15 +0000)
committerjbj <devnull@localhost>
Tue, 8 Feb 2005 17:15:10 +0000 (17:15 +0000)
CVS patchset: 7746
CVS date: 2005/02/08 17:15:10

rpmio/rpmio_internal.h

index 13c89ac..660ca15 100644 (file)
@@ -418,7 +418,14 @@ void fdstat_exit(/*@null@*/ FD_t fd, int opx, ssize_t rc)
     if (rc == -1)
        fd->syserrno = errno;
     else if (rc > 0 && fd->bytesRemain > 0)
+       switch (opx) {
+       case FDSTAT_READ:
+       case FDSTAT_WRITE:
        fd->bytesRemain -= rc;
+           break;
+       default:
+           break;
+       }
     if (fd->stats != NULL)
        (void) rpmswExit(fdstat_op(fd, opx), rc);
 }