Skip to content

Commit

Permalink
WIP: tx_abort
Browse files Browse the repository at this point in the history
  • Loading branch information
ddustin committed Dec 14, 2023
1 parent a48e225 commit e3cd1c9
Show file tree
Hide file tree
Showing 27 changed files with 654 additions and 148 deletions.
6 changes: 5 additions & 1 deletion ccan/ccan/read_write_all/read_write_all.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ bool write_all(int fd, const void *data, size_t size)
return true;
}

int read_all_last_result_on_false = -1;

bool read_all(int fd, void *data, size_t size)
{
while (size) {
Expand All @@ -28,8 +30,10 @@ bool read_all(int fd, void *data, size_t size)
done = read(fd, data, size);
if (done < 0 && errno == EINTR)
continue;
if (done <= 0)
if (done <= 0) {
read_all_last_result_on_false = done;
return false;
}
data = (char *)data + done;
size -= done;
}
Expand Down

0 comments on commit e3cd1c9

Please sign in to comment.