diff options
author | Anton Kling <anton@kling.gg> | 2023-10-24 14:42:55 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2023-10-24 14:42:55 +0200 |
commit | 11292853de086dce7d443d5f80bf5a0e8ffc0335 (patch) | |
tree | 8727bacd24699c44779681c460eb0b36e71592e0 /userland | |
parent | 3f06662e22732c45948a9ebf5a330b2505f418d0 (diff) |
ante: Truncate the file before writing to it.
Previously the file size would not decrease even if data was deleted.
Diffstat (limited to 'userland')
-rw-r--r-- | userland/ante/ante.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/userland/ante/ante.c b/userland/ante/ante.c index 003b03c..7fc1315 100644 --- a/userland/ante/ante.c +++ b/userland/ante/ante.c @@ -220,6 +220,7 @@ void draw_file(void) { void write_file(void) { assert(file_buffer); + assert(0 == ftruncate(file_fd, file_size)); pwrite(file_fd, file_buffer, file_size, 0); } |