[PATCH evemu 3/7] test: check ftruncate() return code

Peter Hutterer peter.hutterer at who-t.net
Tue Aug 18 18:03:26 PDT 2015


To shut up coverity

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 test/test-evemu-create.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/test-evemu-create.c b/test/test-evemu-create.c
index 27fb326..8ea9b48 100644
--- a/test/test-evemu-create.c
+++ b/test/test-evemu-create.c
@@ -72,8 +72,10 @@ void check_evemu_read(int fd, const char *file, enum flags flags)
 	FILE *fp;
 	struct evemu_device *dev;
 	const char *device_name;
+	int rc;
 
-	ftruncate(fd, 0);
+	rc = ftruncate(fd, 0);
+	assert(rc == 0);
 	lseek(fd, 0, SEEK_SET);
 
 	if (flags & EMPTYLINE)
-- 
2.4.3



More information about the Input-tools mailing list