diff mbox

gdb build problem (gdb/unittests/scoped_mmap-selftests.c)

Message ID 87o9ec91tu.fsf@tromey.com
State New
Headers show

Commit Message

Tom Tromey Aug. 8, 2018, 5:59 p.m. UTC
>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:

Simon> Oops, sorry for the breakage.  Tom's fix LGTM.

Here's what I'm checking in.

Tom

commit 1ca8d27a27b8f05272764bf9ac1799cd86c74f52
Author: Tom Tromey <tom@tromey.com>
Date:   Wed Aug 8 11:57:39 2018 -0600

    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".
diff mbox

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 682520fc400..4181da6c01a 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  Andrew Burgess  <andrew.burgess@embecosm.com>
 
 	PR gdb/18050:
diff --git a/gdb/unittests/scoped_mmap-selftests.c b/gdb/unittests/scoped_mmap-selftests.c
index d70a56a1862..e9d4afdffc5 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);