build: a more portable way of finding waf in makefiles
[sfrench/samba-autobuild/.git] / tests / ftruncate.c
index 93282782eedb15207ce51e42baaa377c9fc2961a..d3e5de3afbe695baaaecb1f0c214401d450ccf78 100644 (file)
@@ -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);