public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: Tom Tromey <tom@tromey.com>,  Steve Ellcey <sellcey@cavium.com>,
	 gdb-patches <gdb-patches@sourceware.org>,
	 simon.marchi@ericsson.com
Subject: Re: gdb build problem (gdb/unittests/scoped_mmap-selftests.c)
Date: Wed, 08 Aug 2018 18:00:00 -0000	[thread overview]
Message-ID: <87o9ec91tu.fsf@tromey.com> (raw)
In-Reply-To: <a1d4ea91a4a2884a72ebf4780d1138e2@polymtl.ca> (Simon Marchi's	message of "Wed, 08 Aug 2018 13:39:18 -0400")

>>>>> "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 --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);

  parent reply	other threads:[~2018-08-08 18:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-08 15:42 Steve Ellcey
2018-08-08 17:35 ` Tom Tromey
2018-08-08 17:39   ` Simon Marchi
2018-08-08 17:57     ` Tom Tromey
2018-08-08 22:17       ` Simon Marchi
2018-08-09 13:28       ` Pedro Alves
2018-08-09 14:34         ` Tom Tromey
2018-08-08 18:00     ` Tom Tromey [this message]
2018-08-08 17:49   ` Steve Ellcey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o9ec91tu.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sellcey@cavium.com \
    --cc=simon.marchi@ericsson.com \
    --cc=simon.marchi@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).