aboutsummaryrefslogtreecommitdiff
path: root/gdb/unittests
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-08-08 11:57:39 -0600
committerTom Tromey <tom@tromey.com>2018-08-08 11:59:44 -0600
commit83202f7ae849e538c04656923312d0eab32f6cea (patch)
tree2d54c19add182aa7184b8d8dbc7f47d13a49008b /gdb/unittests
parent5c720ed8861b461193a507e61e3665b1cc840055 (diff)
downloadgdb-83202f7ae849e538c04656923312d0eab32f6cea.zip
gdb-83202f7ae849e538c04656923312d0eab32f6cea.tar.gz
gdb-83202f7ae849e538c04656923312d0eab32f6cea.tar.bz2
Check result of "write"
Some distros enable _FORTIFY_SOURCE by default, which caught a failure to check the result of "write" in scoped_mmap-selftests.c. This patch fixes the problem. ChangeLog 2018-08-08 Tom Tromey <tom@tromey.com> * unittests/scoped_mmap-selftests.c: Check result of "write".
Diffstat (limited to 'gdb/unittests')
-rw-r--r--gdb/unittests/scoped_mmap-selftests.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/unittests/scoped_mmap-selftests.c b/gdb/unittests/scoped_mmap-selftests.c
index d70a56a..e9d4afd 100644
--- a/gdb/unittests/scoped_mmap-selftests.c
+++ b/gdb/unittests/scoped_mmap-selftests.c
@@ -91,7 +91,7 @@ test_normal ()
int fd = mkstemp (filename);
SELF_CHECK (fd >= 0);
- write (fd, "Hello!", 7);
+ SELF_CHECK (write (fd, "Hello!", 7) == 7);
close (fd);
gdb::unlinker unlink_test_file (filename);