[klibc] kinit: Fix capabilities alternate read/write io without flush
Just fseek back to the start.
Signed-off-by: maximilian attems <max@stro.at>
diff --git a/usr/kinit/capabilities.c b/usr/kinit/capabilities.c
index eab4d93..c606144 100644
--- a/usr/kinit/capabilities.c
+++ b/usr/kinit/capabilities.c
@@ -167,6 +167,9 @@
hi32 &= ~(1 << (cap_ordinal - 32));
/* Commit the new bit masks to the kernel */
+ ret = fseek(file, 0L, SEEK_SET);
+ if (ret != 0)
+ fail("Failed on file %s to seek %d\n", filename, ret);
sprintf(buf, "%u %u", lo32, hi32);
ret = fwrite(buf, 1, strlen(buf) + 1, file);
if (ret != 0)