aboutsummaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
authorFrédéric Bérat <fberat@redhat.com>2023-04-28 14:21:39 +0200
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2023-06-01 12:45:13 -0400
commit32043daaafcd59793b9addf7af1bcedb3b666f09 (patch)
tree2be44a97aaee5d057b630e885c384bde05b70ea5 /posix
parent026a84a54d3b6c23b999b793e2a6f8ecd211e3b8 (diff)
downloadglibc-32043daaafcd59793b9addf7af1bcedb3b666f09.zip
glibc-32043daaafcd59793b9addf7af1bcedb3b666f09.tar.gz
glibc-32043daaafcd59793b9addf7af1bcedb3b666f09.tar.bz2
tests: replace ftruncate by xftruncate
With fortification enabled, ftruncate calls return result needs to be checked, has it gets the __wur macro enabled. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Diffstat (limited to 'posix')
-rw-r--r--posix/tst-getopt-cancel.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/posix/tst-getopt-cancel.c b/posix/tst-getopt-cancel.c
index 7167d1a..6f49391 100644
--- a/posix/tst-getopt-cancel.c
+++ b/posix/tst-getopt-cancel.c
@@ -33,6 +33,7 @@
#include <support/support.h>
#include <support/temp_file.h>
#include <support/xthread.h>
+#include <support/xunistd.h>
static bool
check_stderr (bool expect_errmsg, FILE *stderr_trapped)
@@ -48,7 +49,7 @@ check_stderr (bool expect_errmsg, FILE *stderr_trapped)
fputs (lineptr, stdout);
}
rewind (stderr_trapped);
- ftruncate (fileno (stderr_trapped), 0);
+ xftruncate (fileno (stderr_trapped), 0);
return got_errmsg == expect_errmsg;
}