Patchwork [20/36] gdbserver/tracepoint: Add cast sockaddr_un/sockaddr cast

login
register
mail settings
Submitter Pedro Alves
Date Feb. 9, 2015, 11:20 p.m.
Message ID <1423524046-20605-21-git-send-email-palves@redhat.com>
Download mbox | patch
Permalink /patch/4994/
State New
Headers show

Comments

Pedro Alves - Feb. 9, 2015, 11:20 p.m.
Fixes this in C++ mode:

  gdb/gdbserver/tracepoint.c: In function ‘void* gdb_agent_helper_thread(void*)’:
  gdb/gdbserver/tracepoint.c:7190:47: error: cannot convert ‘sockaddr_un*’ to ‘sockaddr*’ for argument ‘2’ to ‘int accept(int, sockaddr*, socklen_t*)’
	  fd = accept (listen_fd, &sockaddr, &tmp);

gdb/gdbserver/ChangeLog:
2015-02-09  Pedro Alves  <palves@redhat.com>

	* tracepoint.c (gdb_agent_helper_thread): Cast 'sockaddr' to
	'struct sockaddr' pointer in 'accept' call.
---
 gdb/features/feature_to_c.sh | 0
 gdb/gdbserver/tracepoint.c   | 2 +-
 2 files changed, 1 insertion(+), 1 deletion(-)
 mode change 100644 => 100755 gdb/features/feature_to_c.sh

Patch

diff --git a/gdb/features/feature_to_c.sh b/gdb/features/feature_to_c.sh
old mode 100644
new mode 100755
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index 9f87257..dde3597 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -7168,7 +7168,7 @@  gdb_agent_helper_thread (void *arg)
 
 	  do
 	    {
-	      fd = accept (listen_fd, &sockaddr, &tmp);
+	      fd = accept (listen_fd, (struct sockaddr *) &sockaddr, &tmp);
 	    }
 	  /* It seems an ERESTARTSYS can escape out of accept.  */
 	  while (fd == -512 || (fd == -1 && errno == EINTR));