mirror of
https://github.com/swaywm/sway.git
synced 2026-04-22 06:46:27 -04:00
Merge 3e69928f13 into c32a507303
This commit is contained in:
commit
df9b88befb
7 changed files with 131 additions and 86 deletions
|
|
@ -550,8 +550,16 @@ int main(int argc, char **argv) {
|
|||
int socketfd = ipc_open_socket(socket_path);
|
||||
struct timeval timeout = {.tv_sec = 3, .tv_usec = 0};
|
||||
ipc_set_recv_timeout(socketfd, timeout);
|
||||
uint32_t len = strlen(command);
|
||||
size_t len = strlen(command);
|
||||
char *resp = ipc_single_command(socketfd, type, command, &len);
|
||||
if (resp == NULL) {
|
||||
if (!quiet) {
|
||||
sway_log(SWAY_ERROR, "Failed to receive reply");
|
||||
}
|
||||
close(socketfd);
|
||||
free(socket_path);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// pretty print the json
|
||||
json_tokener *tok = json_tokener_new_ex(JSON_MAX_DEPTH);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue