diff mbox

[review] Use safe_strerror in agent.c

Message ID gerrit.1575560698000.Icdfcf9fef754253d6b17aeaa78329ea9bdc41bb1@gnutoolchain-gerrit.osci.io
State New
Headers show

Commit Message

Simon Marchi (Code Review) Dec. 5, 2019, 3:44 p.m. UTC
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(-)

Comments

Simon Marchi (Code Review) Dec. 5, 2019, 3:51 p.m. UTC | #1
Christian Biesinger has posted comments on this change.

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


Patch Set 1:

See also https://sourceware.org/ml/gdb-patches/2019-11/msg00931.html
Simon Marchi (Code Review) Dec. 11, 2019, 5:27 p.m. UTC | #2
Christian Biesinger has posted comments on this change.

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


Patch Set 1:

I believe this was fixed by the broader change in https://sourceware.org/ml/gdb-patches/2019-12/msg00372.html
Simon Marchi (Code Review) Dec. 12, 2019, 5:22 p.m. UTC | #3
Tom Tromey has posted comments on this change.

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


Patch Set 1:

> Patch Set 1:
> 
> I believe this was fixed by the broader change in https://sourceware.org/ml/gdb-patches/2019-12/msg00372.html

Yep, I'm dropping this patch.
Simon Marchi (Code Review) Dec. 12, 2019, 5:22 p.m. UTC | #4
Tom Tromey has abandoned this change. ( https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/748 )

Change subject: Use safe_strerror in agent.c
......................................................................


Abandoned

Obsoleted by another patch.
diff mbox

Patch

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;
     }