diff options
author | S. Christoffer Eliesen <christoffer@eliesen.no> | 2015-10-16 13:21:34 +0200 |
---|---|---|
committer | S. Christoffer Eliesen <christoffer@eliesen.no> | 2015-10-16 13:23:08 +0200 |
commit | 783290e81a5947865c00a5af30c1ba5e2ecd1052 (patch) | |
tree | b94de69f9b0b47f1846d8ba15e37b0f20c83ae5c /sway | |
parent | 7cb073203038983ac641770ea8cc0db222ca0df7 (diff) | |
download | sway-783290e81a5947865c00a5af30c1ba5e2ecd1052.tar.xz |
sway/ipc: Use sway_abort instead of returning NULL.
Diffstat (limited to 'sway')
-rw-r--r-- | sway/ipc.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -82,8 +82,8 @@ void ipc_terminate(void) { struct sockaddr_un *ipc_user_sockaddr(void) { struct sockaddr_un *ipc_sockaddr = malloc(sizeof(struct sockaddr_un)); - if (!sway_assert(ipc_sockaddr != NULL, "can't malloc ipc_sockaddr")) { - return NULL; + if (ipc_sockaddr == NULL) { + sway_abort("can't malloc ipc_sockaddr"); } ipc_sockaddr->sun_family = AF_UNIX; @@ -93,8 +93,8 @@ struct sockaddr_un *ipc_user_sockaddr(void) { // Without logind: int allocating_path_size = snprintf(ipc_sockaddr->sun_path, path_size, "/tmp/sway-ipc.%i.sock", getuid()); - if (!sway_assert(allocating_path_size < path_size, "socket path won't fit into ipc_sockaddr->sun_path")) { - return NULL; + if (allocating_path_size >= path_size) { + sway_abort("socket path won't fit into ipc_sockaddr->sun_path"); } return ipc_sockaddr; |