diff options
author | Tom Tromey <tom@tromey.com> | 2018-08-08 11:57:39 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-08-08 11:59:44 -0600 |
commit | 83202f7ae849e538c04656923312d0eab32f6cea (patch) | |
tree | 2d54c19add182aa7184b8d8dbc7f47d13a49008b | |
parent | 5c720ed8861b461193a507e61e3665b1cc840055 (diff) | |
download | gdb-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".
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/unittests/scoped_mmap-selftests.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b534e95..49a7e39 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2018-08-08 Tom Tromey <tom@tromey.com> + + * unittests/scoped_mmap-selftests.c: Check result of "write". + 2018-08-08 Jim Wilson <jimw@sifive.com> * riscv-tdep.c (enum opcode): Add jump, branch, lr, and sc opcodes. 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); |