Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Tom Tromey (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: gdb-patches@sourceware.org
Subject: [review] Use safe_strerror in agent.c
Date: Thu, 05 Dec 2019 15:45:00 -0000	[thread overview]
Message-ID: <gerrit.1575560698000.Icdfcf9fef754253d6b17aeaa78329ea9bdc41bb1@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1575560698000.Icdfcf9fef754253d6b17aeaa78329ea9bdc41bb1@gnutoolchain-gerrit.osci.io>

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/748
......................................................................

Use safe_strerror in agent.c

ARI pointed out that agent.c is using strerror, where gdb generally
prefers safe_strerror.  This patch fixes the problem.

gdb/ChangeLog
2019-12-05  Tom Tromey  <tromey@adacore.com>

	* gdbsupport/agent.c (gdb_connect_sync_socket): Use
	safe_strerror.
	(gdb_connect_sync_socket): Use safe_strerror.

Change-Id: Icdfcf9fef754253d6b17aeaa78329ea9bdc41bb1
---
M gdb/ChangeLog
M gdb/gdbsupport/agent.c
2 files changed, 8 insertions(+), 2 deletions(-)



diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index aff1f2f..e4259c4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
 2019-12-05  Tom Tromey  <tromey@adacore.com>
 
+	* gdbsupport/agent.c (gdb_connect_sync_socket): Use
+	safe_strerror.
+	(gdb_connect_sync_socket): Use safe_strerror.
+
+2019-12-05  Tom Tromey  <tromey@adacore.com>
+
 	* gdbsupport/common-utils.c (string_printf, string_vprintf)
 	(string_vappendf): Add ARI comment.
 
diff --git a/gdb/gdbsupport/agent.c b/gdb/gdbsupport/agent.c
index 6d55f58..50e9500 100644
--- a/gdb/gdbsupport/agent.c
+++ b/gdb/gdbsupport/agent.c
@@ -149,7 +149,7 @@
   res = fd = gdb_socket_cloexec (PF_UNIX, SOCK_STREAM, 0);
   if (res == -1)
     {
-      warning (_("error opening sync socket: %s"), strerror (errno));
+      warning (_("error opening sync socket: %s"), safe_strerror (errno));
       return -1;
     }
 
@@ -168,7 +168,7 @@
     {
       warning (_("error connecting sync socket (%s): %s. "
 		 "Make sure the directory exists and that it is writable."),
-		 path, strerror (errno));
+		 path, safe_strerror (errno));
       close (fd);
       return -1;
     }

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Icdfcf9fef754253d6b17aeaa78329ea9bdc41bb1
Gerrit-Change-Number: 748
Gerrit-PatchSet: 1
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-MessageType: newchange


       reply	other threads:[~2019-12-05 15:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05 15:45 Tom Tromey (Code Review) [this message]
2019-12-05 15:51 ` Christian Biesinger (Code Review)
2019-12-11 17:27 ` Christian Biesinger (Code Review)
2019-12-12 17:22 ` Tom Tromey (Code Review)
2019-12-12 17:23 ` Tom Tromey (Code Review)

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=gerrit.1575560698000.Icdfcf9fef754253d6b17aeaa78329ea9bdc41bb1@gnutoolchain-gerrit.osci.io \
    --to=gerrit@gnutoolchain-gerrit.osci.io \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@sourceware.org \
    /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