aboutsummaryrefslogtreecommitdiff
path: root/gdb/ser-pipe.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/ser-pipe.c')
-rw-r--r--gdb/ser-pipe.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/ser-pipe.c b/gdb/ser-pipe.c
index 274883c..92ad3d9 100644
--- a/gdb/ser-pipe.c
+++ b/gdb/ser-pipe.c
@@ -63,6 +63,7 @@ pipe_open (struct serial *scb, const char *name)
int pdes[2];
int err_pdes[2];
int pid;
+
if (socketpair (AF_UNIX, SOCK_STREAM, 0, pdes) < 0)
return -1;
if (socketpair (AF_UNIX, SOCK_STREAM, 0, err_pdes) < 0)
@@ -146,6 +147,7 @@ static void
pipe_close (struct serial *scb)
{
struct pipe_state *state = scb->state;
+
if (state != NULL)
{
int pid = state->pid;
@@ -167,6 +169,7 @@ void
_initialize_ser_pipe (void)
{
struct serial_ops *ops = XMALLOC (struct serial_ops);
+
memset (ops, 0, sizeof (struct serial_ops));
ops->name = "pipe";
ops->next = 0;