From 7298a9c67aed2d7a5c5c1df55bfa6052cac04d51 Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Date: Sun, 3 Jan 2016 20:40:50 +0100 Subject: Add type to returned response. Makes `ipc_recv_response` return a struct with size, type and payload rather than just the payload string. This is useful if the type has to be checked on the client. --- swaybar/main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'swaybar') diff --git a/swaybar/main.c b/swaybar/main.c index aa761b7d..d534345a 100644 --- a/swaybar/main.c +++ b/swaybar/main.c @@ -1025,9 +1025,8 @@ void poll_for_update() { if (FD_ISSET(ipc_event_socketfd, &readfds)) { sway_log(L_DEBUG, "Got workspace update."); - uint32_t len; - char *buf = ipc_recv_response(ipc_event_socketfd, &len); - free(buf); + struct ipc_response *resp = ipc_recv_response(ipc_event_socketfd); + free_ipc_response(resp); ipc_update_workspaces(); dirty = true; } -- cgit v1.2.3-70-g09d2