[Forensics-changes] [yara] 143/192: Fix warnings due to unused results from ‘write’ and ‘ftruncate’
Hilko Bengen
bengen at moszumanska.debian.org
Sat Jul 1 10:31:58 UTC 2017
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag v3.6.0
in repository yara.
commit 39670c5142aaca880ffdf9e4890d8215cb6e7402
Author: Victor Manuel Alvarez <vmalvarez at vmalvarez-macbookpro.roam.corp.google.com>
Date: Thu Apr 20 19:02:57 2017 +0200
Fix warnings due to unused results from ‘write’ and ‘ftruncate’
---
tests/test-exception.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tests/test-exception.c b/tests/test-exception.c
index 8ea05c5..653905b 100644
--- a/tests/test-exception.c
+++ b/tests/test-exception.c
@@ -56,12 +56,16 @@ int main(int argc, char **argv)
memset(wbuf, 'a', sizeof(wbuf));
for (i = 0; i < COUNT; i++)
- write(fd, wbuf, sizeof(wbuf));
+ {
+ if (write(fd, wbuf, sizeof(wbuf)) != sizeof(wbuf))
+ exit(EXIT_FAILURE);
+ }
uint8_t* mapped_region = mmap(
NULL, COUNT * sizeof(wbuf), PROT_READ, MAP_SHARED, fd, 0);
- ftruncate(fd, COUNT * sizeof(wbuf) / 2);
+ if (ftruncate(fd, COUNT * sizeof(wbuf) / 2) != 0)
+ exit(EXIT_FAILURE);
/*
mapped_region is now only partially backed by the open file
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git
More information about the forensics-changes
mailing list