aboutsummaryrefslogtreecommitdiff
path: root/tests/uns_test.c
diff options
context:
space:
mode:
authorAndrew G. Morgan <morgan@kernel.org>2021-06-20 13:19:40 -0700
committerAndrew G. Morgan <morgan@kernel.org>2021-06-20 13:19:40 -0700
commit2efece0bb49860456ca9357c1e1087bf6f788857 (patch)
tree509c53b02c5c67635414c0aebe4a9ebb0d13fd73 /tests/uns_test.c
parent2c99ecd7ee8580cced618dd9d16473f15e778e5e (diff)
downloadlibcap-2efece0bb49860456ca9357c1e1087bf6f788857.tar.gz
Clean up some compilation warnings
Also amend .gitignore to ignore uns_test binary in the progs directory. Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
Diffstat (limited to 'tests/uns_test.c')
-rw-r--r--tests/uns_test.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/uns_test.c b/tests/uns_test.c
index 43470cf..41aa0a6 100644
--- a/tests/uns_test.c
+++ b/tests/uns_test.c
@@ -137,7 +137,10 @@ int main(int argc, char **argv)
}
}
- write(fds.to[1], ".", 1);
+ if (write(fds.to[1], ".", 1) != 1) {
+ perror("failed to write '.'");
+ exit(1);
+ }
close(fds.to[1]);
fprintf(stderr, "user namespace launched exploit worked - upgrade kernel\n");
@@ -149,6 +152,6 @@ int main(int argc, char **argv)
bailok:
fprintf(stderr, "exploit attempt failed\n");
- write(fds.to[1], "!", 1);
+ (void) write(fds.to[1], "!", 1);
exit(0);
}