aboutsummaryrefslogtreecommitdiff
path: root/swaymsg
diff options
context:
space:
mode:
Diffstat (limited to 'swaymsg')
-rw-r--r--swaymsg/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/swaymsg/main.c b/swaymsg/main.c
index 8d20905a..3a2e1ee7 100644
--- a/swaymsg/main.c
+++ b/swaymsg/main.c
@@ -93,10 +93,13 @@ int main(int argc, char **argv) {
command = join_args(argv + optind, argc - optind);
}
- char *resp = ipc_single_command(socket_path, type, command, strlen(command));
+ int socketfd = ipc_open_socket(socket_path);
+ uint32_t len = strlen(command);
+ char *resp = ipc_single_command(socketfd, type, command, &len);
if (!quiet) {
printf("%s", resp);
}
+ close(socketfd);
free(command);
free(resp);