Branch Coverage

src/b_file.c
Criterion Covered Total %
branch 42 60 70.0


line true false branch
35 27794 5834 for (i=0; i
41 0 27794 if ((block = b_buffer_get_block(buf, B_BLOCK_SIZE, &blocklen)) == NULL) {
66 0 4 if (linkdest)
72 0 4 if (full_len == (size_t)-1)
75 0 4 if ((buffer = malloc(total_len + 1)) == NULL)
79 0 4 if (linkdest)
82 4 4 for (i=0; i
89 0 4 if ((block = b_buffer_get_block(buf, B_BLOCK_SIZE, &blocklen)) == NULL) {
114 39737 12649 if (b_buffer_full(buf)) {
115 0 39737 if (b_buffer_flush(buf) < 0) {
125 32512 19874 if (max_read > MAX_CHUNK_SIZE) {
128 6771 13103 else if (max_read == 0) {
136 39336 6279 if (emptied_buffer && buf->can_splice) {
292 39044 if (emptied_buffer && buf->can_splice) {
137 292 0 if ((rlen = splice(file_fd, NULL, buf->fd, NULL, max_read, 0))){
138 0 292 if (rlen < 0) {
147 39336 6279 if (!emptied_buffer || !buf->can_splice) {
39044 292 if (!emptied_buffer || !buf->can_splice) {
151 0 45323 if ((block = b_buffer_get_block(buf, b_buffer_unused(buf), &blocklen)) == NULL) {
155 39048 6275 if (max_read > blocklen) {
160 4 45319 if ((rlen = read(file_fd, block, max_read)) < max_read) {
161 0 4 if (rlen < 0 && errno == EINTR) { goto read_retry; }
0 0 if (rlen < 0 && errno == EINTR) { goto read_retry; }
171 6275 39044 if (blocklen - rlen) {
178 45611 0 } while (rlen > 0);
181 292 6479 if (splice_total && buf->can_splice && total % B_BUFFER_BLOCK_SIZE != 0) {
292 0 if (splice_total && buf->can_splice && total % B_BUFFER_BLOCK_SIZE != 0) {
292 0 if (splice_total && buf->can_splice && total % B_BUFFER_BLOCK_SIZE != 0) {
186 0 292 if ((write(buf->fd, buf->data, B_BUFFER_BLOCK_SIZE - (total % B_BUFFER_BLOCK_SIZE))) < 0) {
195 4 0 if (!errno) {