aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaximilian attems <max@stro.at>2012-05-27 23:18:07 +0200
committermaximilian attems <max@stro.at>2012-05-27 23:18:07 +0200
commit8544fef6d5e5bc8f927ffbd3e4031b905c907de9 (patch)
tree12dff8b996bf97935733b447f3ba9be880bb99b7
parent850f98fa9ae27221b9086361251604e97a9eb686 (diff)
downloadklibc-8544fef6d5e5bc8f927ffbd3e4031b905c907de9.tar.gz
[klibc] kinit: Fix capabilities alternate read/write io without flush
Just fseek back to the start. Signed-off-by: maximilian attems <max@stro.at>
-rw-r--r--usr/kinit/capabilities.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/usr/kinit/capabilities.c b/usr/kinit/capabilities.c
index eab4d937af1f6..c60614487fff3 100644
--- a/usr/kinit/capabilities.c
+++ b/usr/kinit/capabilities.c
@@ -167,6 +167,9 @@ static void do_usermodehelper_file(const char *filename, int cap_ordinal)
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)