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

Pedro Alves
2015-02-09T23:21:42Z

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

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));
--
1.9.3