Skip to content

Commit

Permalink
Add socket path to IPC errors for more clarity
Browse files Browse the repository at this point in the history
`Error calling bind() on socket: Permission denied` is not a clear error
message, because the socket that needs to be checked is not mentioned.

New error message:
`Error calling bind() on socket /tmp/luakit-ipc...: Permission denied`
  • Loading branch information
c0dev0id committed Sep 23, 2020
1 parent 916c31e commit 1b06490
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ipc.c
Expand Up @@ -129,10 +129,10 @@ web_extension_connect_thread(gpointer UNUSED(data))
unlink(local.sun_path);

if (bind(sock, (struct sockaddr *)&local, len) == -1)
fatal("Error calling bind(): %s", strerror(errno));
fatal("Error calling bind() on socket %s: %s", path, strerror(errno));

if (listen(sock, 5) == -1)
fatal("Error calling listen(): %s", strerror(errno));
fatal("Error calling listen() on socket %s: %s", path, strerror(errno));

g_mutex_lock(&socket_path_lock);
socket_path = path;
Expand Down

0 comments on commit 1b06490

Please sign in to comment.