Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
Pushed to trunk as r16-5207-ge7e1f2e40a2d1c.

gcc/ChangeLog:
        PR diagnostics/115970
        * diagnostics/sarif-sink.cc (maybe_open_sarif_sink_for_socket):
        Add "%m" to error messages, so that we print the string form of
        errno.

Signed-off-by: David Malcolm <[email protected]>
---
 gcc/diagnostics/sarif-sink.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/diagnostics/sarif-sink.cc b/gcc/diagnostics/sarif-sink.cc
index 6ca02b23c0f9..76aec2a886c5 100644
--- a/gcc/diagnostics/sarif-sink.cc
+++ b/gcc/diagnostics/sarif-sink.cc
@@ -4579,7 +4579,7 @@ maybe_open_sarif_sink_for_socket (context &dc)
   unique_fd sfd (socket (AF_UNIX, SOCK_STREAM, 0));
   if (sfd == -1)
     fatal_error (UNKNOWN_LOCATION,
-                "unable to create socket");
+                "unable to create socket: %m");
 
   struct sockaddr_un addr;
   memset (&addr, 0, sizeof (addr));
@@ -4588,7 +4588,7 @@ maybe_open_sarif_sink_for_socket (context &dc)
 
   if (connect (sfd, (struct sockaddr *)&addr, sizeof (addr)) == -1)
     fatal_error (UNKNOWN_LOCATION,
-                "unable to connect to %qs",
+                "unable to connect to %qs: %m",
                 socket_name);
 
   /* TODO: should there be a way to specify other key/value
-- 
2.26.3

Reply via email to