diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2007-06-12 06:43:16 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2007-06-12 06:43:16 +0000 |
commit | e703434f83af5a41cb2f27604aedc8b2d15024e2 (patch) | |
tree | 71bcb3e17135ef1c23c2f63dc3b19e4479f7682d /audio/unix.c | |
parent | c1fe207c205d3122a496b11d36132940e34568a4 (diff) |
Cleanup
Diffstat (limited to 'audio/unix.c')
-rw-r--r-- | audio/unix.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/audio/unix.c b/audio/unix.c index 00f146be..163f4f98 100644 --- a/audio/unix.c +++ b/audio/unix.c @@ -72,7 +72,7 @@ static int unix_sendmsg_fd(int sock, int fd, struct ipc_packet *pkt) cmsg->cmsg_type = SCM_RIGHTS; cmsg->cmsg_len = CMSG_LEN(sizeof(int)); /* Initialize the payload */ - (*(int *)CMSG_DATA(cmsg)) = fd; + (*(int *) CMSG_DATA(cmsg)) = fd; return sendmsg(sock, &msgh, MSG_NOSIGNAL); } @@ -100,9 +100,14 @@ static gboolean unix_event(GIOChannel *chan, GIOCondition cond, gpointer data) memset(&addr, 0, sizeof(addr)); addrlen = sizeof(addr); + clisk = accept(sk, (struct sockaddr *) &addr, &addrlen); + if (clisk < 0) { + error("accept: %s (%d)", strerror(errno), errno); + return TRUE; + } + len = sizeof(struct ipc_packet) + sizeof(struct ipc_data_cfg); pkt = g_malloc0(len); - clisk = accept(sk, (struct sockaddr *) &addr, &addrlen); len = recv(clisk, pkt, len, 0); debug("path %s len %d", addr.sun_path + 1, len); @@ -128,6 +133,7 @@ static gboolean unix_event(GIOChannel *chan, GIOCondition cond, gpointer data) len = send(clisk, pkt, len, 0); if (len < 0) info("Error %s(%d)", strerror(errno), errno); + info("%d bytes sent", len); if (cfg->fd != -1) { |