Merge pull request #4647 from psychon/refuse-start-without-ipc-socket
Refuse to start without IPC socket
This commit is contained in:
12
src/main.c
12
src/main.c
@ -683,6 +683,11 @@ int main(int argc, char *argv[]) {
|
|||||||
else
|
else
|
||||||
config.ipc_socket_path = sstrdup(config.ipc_socket_path);
|
config.ipc_socket_path = sstrdup(config.ipc_socket_path);
|
||||||
}
|
}
|
||||||
|
/* Create the UNIX domain socket for IPC */
|
||||||
|
int ipc_socket = create_socket(config.ipc_socket_path, ¤t_socketpath);
|
||||||
|
if (ipc_socket == -1) {
|
||||||
|
die("Could not create the IPC socket: %s", config.ipc_socket_path);
|
||||||
|
}
|
||||||
|
|
||||||
if (config.force_xinerama) {
|
if (config.force_xinerama) {
|
||||||
force_xinerama = true;
|
force_xinerama = true;
|
||||||
@ -988,15 +993,10 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
tree_render();
|
tree_render();
|
||||||
|
|
||||||
/* Create the UNIX domain socket for IPC */
|
/* Listen to the IPC socket for clients */
|
||||||
int ipc_socket = create_socket(config.ipc_socket_path, ¤t_socketpath);
|
|
||||||
if (ipc_socket == -1) {
|
|
||||||
ELOG("Could not create the IPC socket, IPC disabled\n");
|
|
||||||
} else {
|
|
||||||
struct ev_io *ipc_io = scalloc(1, sizeof(struct ev_io));
|
struct ev_io *ipc_io = scalloc(1, sizeof(struct ev_io));
|
||||||
ev_io_init(ipc_io, ipc_new_client, ipc_socket, EV_READ);
|
ev_io_init(ipc_io, ipc_new_client, ipc_socket, EV_READ);
|
||||||
ev_io_start(main_loop, ipc_io);
|
ev_io_start(main_loop, ipc_io);
|
||||||
}
|
|
||||||
|
|
||||||
/* Chose a file name in /tmp/ based on the PID */
|
/* Chose a file name in /tmp/ based on the PID */
|
||||||
char *log_stream_socket_path = get_process_filename("log-stream-socket");
|
char *log_stream_socket_path = get_process_filename("log-stream-socket");
|
||||||
|
Reference in New Issue
Block a user