Fix Coverity ID 519 (NEGATIVE_RETURNS)
authorVolker Lendecke <vl@samba.org>
Wed, 11 Feb 2009 11:00:19 +0000 (12:00 +0100)
committerVolker Lendecke <vl@samba.org>
Wed, 11 Feb 2009 11:20:42 +0000 (12:20 +0100)
tests/ftruncate.c

index 9328278..d3e5de3 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);