]> code.citadel.org Git - citadel.git/blobdiff - citadel/citadel_ipc.c
* Made some changes to the hunt for citadel.socket when built in
[citadel.git] / citadel / citadel_ipc.c
index e519e870798ad77911d4efa9daf2394f0eda8944..eec241329a866869fb4a1c6d19014d5cd98a65e2 100644 (file)
@@ -2940,23 +2940,14 @@ CtdlIPC* CtdlIPC_new(int argc, char **argv, char *hostbuf, char *portbuf)
        /* If we're using a unix domain socket we can do a bunch of stuff */
        if (!strcmp(cithost, UDS)) {
                if (!strcasecmp(citport, DEFAULT_PORT)) {
-                       snprintf(sockpath, sizeof sockpath, "%s%s",
-#ifndef HAVE_RUN_DIR
-                                        CTDLDIR
+#ifdef HAVE_RUN_DIR
+                       snprintf(sockpath, sizeof sockpath, RUNDIR "/citadel.socket");
 #else
-                                        RUN_DIR
+                       snprintf(sockpath, sizeof sockpath, CTDLDIR "/citadel.socket");
 #endif
-                                        , "/citadel.socket");
                }
                else {
-                       snprintf(sockpath, sizeof sockpath, "%s%s",
-                               citport, 
-#ifndef HAVE_RUN_DIR
-                                        CTDLDIR
-#else
-                                        RUN_DIR
-#endif
-                                        "/citadel.socket");
+                       snprintf(sockpath, sizeof sockpath, "%s/%s", citport, "citadel.socket");
                }
                ipc->sock = uds_connectsock(&(ipc->isLocal), sockpath);
                if (ipc->sock == -1) {