about summary refs log tree commit diff
path: root/posix/tst-getopt-cancel.c
diff options
context:
space:
mode:
Diffstat (limited to 'posix/tst-getopt-cancel.c')
-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 7167d1a914..6f49391690 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;
 }