summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ftruncate.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/ftruncate.c b/tests/ftruncate.c
index 93282782ee..d3e5de3afb 100644
--- a/tests/ftruncate.c
+++ b/tests/ftruncate.c
@@ -16,6 +16,10 @@ main()
int *buf;
int fd = open(DATA,O_RDWR|O_CREAT|O_TRUNC,0666);
+ if (fd == -1) {
+ exit(1);
+ }
+
ftruncate(fd, LEN);
unlink(DATA);