summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pullreqd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pullreqd.c b/pullreqd.c
index f077a50..3645f2f 100644
--- a/pullreqd.c
+++ b/pullreqd.c
@@ -96,7 +96,7 @@ int init_socket(config *cfg) {
/* Size of the socket address we're using. */
size_t sockaddr_size = 0;
/* Set socket type to unix socket, if socket-type was set to unix, otherwise set it to network socket. */
- const int sock_type = (!strcasecmp(cfg->sock_type, "unix")) ? AF_UNIX : AF_INET;
+ const int sock_type = (strcasecmp(cfg->sock_type, "unix") == 0) ? AF_UNIX : AF_INET;
if (sock_type == AF_UNIX) {
size_t path_length = strlen(cfg->sock);
@@ -180,7 +180,7 @@ void cleanup(config *cfg, int listen_socket) {
if (listen_socket > 0) {
close(listen_socket);
/* Is this a unix domain socket? */
- if (!strcasecmp(cfg->sock_type, "unix")) {
+ if (strcasecmp(cfg->sock_type, "unix") == 0) {
unlink(cfg->sock);
}
}