From f0f7cb74780314dff1fae99079e01a45728219fb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fernando=20Tarl=C3=A1=20Cardoso=20Lemos?= Date: Mon, 21 Mar 2011 09:05:58 -0300 Subject: [PATCH] If the socket path isn't specified, write it to /tmp. --- src/main.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main.c b/src/main.c index d1b1a532..2bda27c5 100644 --- a/src/main.c +++ b/src/main.c @@ -262,6 +262,8 @@ int main(int argc, char *argv[]) { if (config.ipc_socket_path == NULL) { config.ipc_socket_path = getenv("I3SOCK"); + if (config.ipc_socket_path == NULL) + config.ipc_socket_path = get_process_filename("i3-ipc-socket"); } uint32_t mask = XCB_CW_EVENT_MASK; @@ -382,15 +384,13 @@ int main(int argc, char *argv[]) { die("Could not initialize libev. Bad LIBEV_FLAGS?\n"); /* Create the UNIX domain socket for IPC */ - if (config.ipc_socket_path != NULL) { - int ipc_socket = ipc_create_socket(config.ipc_socket_path); - if (ipc_socket == -1) { - ELOG("Could not create the IPC socket, IPC disabled\n"); - } else { - struct ev_io *ipc_io = scalloc(sizeof(struct ev_io)); - ev_io_init(ipc_io, ipc_new_client, ipc_socket, EV_READ); - ev_io_start(loop, ipc_io); - } + int ipc_socket = ipc_create_socket(config.ipc_socket_path); + if (ipc_socket == -1) { + ELOG("Could not create the IPC socket, IPC disabled\n"); + } else { + struct ev_io *ipc_io = scalloc(sizeof(struct ev_io)); + ev_io_init(ipc_io, ipc_new_client, ipc_socket, EV_READ); + ev_io_start(loop, ipc_io); } /* Set up i3 specific atoms like I3_SOCKET_PATH and I3_CONFIG_PATH */ -- 2.39.5