aboutsummaryrefslogtreecommitdiffstats
path: root/store/store-log.c
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-01 18:19:14 +0100
committereunhhu <[email protected]>2026-10-01 18:19:14 +0100
commit8450156e98ee49484f3fadad791d5684f9576f8b (patch)
treef49de4bdf2dd7d45e2c3da097243ff9391ef59bb /store/store-log.c
parent1c378188e66ed9a14a3f1053ea7385ddcbe8db27 (diff)
downloadpure-8450156e98ee49484f3fadad791d5684f9576f8b.tar.gz
pure-8450156e98ee49484f3fadad791d5684f9576f8b.zip
Build with clang, and the core and store on macOS, again
Apple clang 21 (an M3) and clang 19 refused what gcc let pass (research 029): - PURE_FIELD_REST was an enum of UINT32_MAX, past an int (C17): a macro. - a store's publish copied an entry rebuild left unset when the record was not found (the copy was never used): copied when it was made. - the log's image writer kept a count only Linux's sync_file_range uses. - ",{" + (row == from) read as adding an int to a string: said plainly. - the tests: mkdtemp, hidden by _POSIX_C_SOURCE on macOS, needs _DARWIN_C_SOURCE; a string split so that \x80 and a stay apart is bracketed; a count left over and a malloc measure only glibc has. The core's and the store's tests pass on the Mac.
Diffstat (limited to 'store/store-log.c')
-rw-r--r--store/store-log.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/store/store-log.c b/store/store-log.c
index f73d2bc..7b6f00c 100644
--- a/store/store-log.c
+++ b/store/store-log.c
@@ -493,7 +493,10 @@ PureResult pure_image_write(const char *directory, const char *name, bool (*next
put64(head + 8, 0); /* its length, once known */
Digest digest = {0};
bool ok = write_all(fd, head, sizeof(head), 0), produced = true;
- uint64_t at = sizeof(head), started = 0;
+ uint64_t at = sizeof(head);
+#if defined(__linux__)
+ uint64_t started = 0; /* the bytes handed to the device */
+#endif
for (PureSpan chunk; ok && (produced = next(context, &chunk)) && chunk.size;)
for (size_t done = 0; ok && done < chunk.size;) {
size_t take = chunk.size - done < STEP ? chunk.size - done : STEP;