Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [review] Use safe_strerror in agent.c
@ 2019-12-05 15:45 Tom Tromey (Code Review)
  2019-12-05 15:51 ` Christian Biesinger (Code Review)
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Tom Tromey (Code Review) @ 2019-12-05 15:45 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-12-12 17:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-05 15:45 [review] Use safe_strerror in agent.c Tom Tromey (Code Review)
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)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox