diff options
Diffstat (limited to 'gdb/gdbserver/tracepoint.c')
-rw-r--r-- | gdb/gdbserver/tracepoint.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c index 6c34ad4..27fcf03 100644 --- a/gdb/gdbserver/tracepoint.c +++ b/gdb/gdbserver/tracepoint.c @@ -6817,7 +6817,8 @@ run_inferior_command (char *cmd, int len) #else /* !IN_PROCESS_AGENT */ -#include "gdb_socket.h" +#include <sys/socket.h> +#include <sys/un.h> #ifndef UNIX_PATH_MAX #define UNIX_PATH_MAX sizeof(((struct sockaddr_un *) NULL)->sun_path) @@ -6836,7 +6837,7 @@ static int init_named_socket (const char *name) { int result, fd; - union gdb_sockaddr_u addr; + struct sockaddr_un addr; result = fd = socket (PF_UNIX, SOCK_STREAM, 0); if (result == -1) @@ -6845,10 +6846,10 @@ init_named_socket (const char *name) return -1; } - addr.sa_un.sun_family = AF_UNIX; + addr.sun_family = AF_UNIX; - strncpy (addr.sa_un.sun_path, name, UNIX_PATH_MAX); - addr.sa_un.sun_path[UNIX_PATH_MAX - 1] = '\0'; + strncpy (addr.sun_path, name, UNIX_PATH_MAX); + addr.sun_path[UNIX_PATH_MAX - 1] = '\0'; result = access (name, F_OK); if (result == 0) @@ -6864,7 +6865,7 @@ init_named_socket (const char *name) warning ("socket %s already exists; overwriting", name); } - result = bind (fd, &addr.sa, sizeof (addr.sa_un)); + result = bind (fd, (struct sockaddr *) &addr, sizeof (addr)); if (result == -1) { warning ("bind failed: %s", strerror (errno)); @@ -7163,17 +7164,17 @@ gdb_agent_helper_thread (void *arg) while (1) { socklen_t tmp; - union gdb_sockaddr_u sockaddr; + struct sockaddr_un sockaddr; int fd; char buf[1]; int ret; int stop_loop = 0; - tmp = sizeof (sockaddr.sa_un); + tmp = sizeof (sockaddr); do { - fd = accept (listen_fd, &sockaddr.sa, &tmp); + fd = accept (listen_fd, &sockaddr, &tmp); } /* It seems an ERESTARTSYS can escape out of accept. */ while (fd == -512 || (fd == -1 && errno == EINTR)); |