summaryrefslogtreecommitdiff
path: root/android/ipc.c
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2013-11-07 10:10:34 +0100
committerJohan Hedberg <johan.hedberg@intel.com>2013-11-07 17:05:07 +0200
commit32f29761bf0bcd5cab85a7998286ce89bac0567f (patch)
tree08855648f391a9ad4770b9cf85cfe394bd0f5d82 /android/ipc.c
parent718032446ae38fc0698c287ea9d87740f8aed863 (diff)
downloadbluez-32f29761bf0bcd5cab85a7998286ce89bac0567f.tar.gz
android: Make IPC helpers accept file descriptor
There is no need to pass GIOChannel as writes are done immediately.
Diffstat (limited to 'android/ipc.c')
-rw-r--r--android/ipc.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/android/ipc.c b/android/ipc.c
index e672bf818..9a8657d44 100644
--- a/android/ipc.c
+++ b/android/ipc.c
@@ -32,13 +32,11 @@
#include <signal.h>
#include <sys/socket.h>
-#include <glib.h>
-
#include "hal-msg.h"
#include "ipc.h"
#include "log.h"
-void ipc_send(GIOChannel *io, uint8_t service_id, uint8_t opcode, uint16_t len,
+void ipc_send(int sk, uint8_t service_id, uint8_t opcode, uint16_t len,
void *param, int fd)
{
struct msghdr msg;
@@ -76,17 +74,17 @@ void ipc_send(GIOChannel *io, uint8_t service_id, uint8_t opcode, uint16_t len,
msg.msg_controllen = sizeof(cmsgbuf);
}
- if (sendmsg(g_io_channel_unix_get_fd(io), &msg, 0) < 0) {
+ if (sendmsg(sk, &msg, 0) < 0) {
error("IPC send failed, terminating :%s", strerror(errno));
raise(SIGTERM);
}
}
-void ipc_send_rsp(GIOChannel *io, uint8_t service_id, uint8_t status)
+void ipc_send_rsp(int sk, uint8_t service_id, uint8_t status)
{
struct hal_status s;
s.code = status;
- ipc_send(io, service_id, HAL_OP_STATUS, sizeof(s), &s, -1);
+ ipc_send(sk, service_id, HAL_OP_STATUS, sizeof(s), &s, -1);
}