]> code.citadel.org Git - citadel.git/blobdiff - citadel/citadel_ipc.c
* Numerous fixups needed for Windows port:
[citadel.git] / citadel / citadel_ipc.c
index 921e7d63b47ebbd7597d8694f4afb6ca2e55085e..97cd0ac3d5341159a440e6c938209e18426bcd00 100644 (file)
@@ -1,7 +1,11 @@
 /* $Id$ */
 
 #define        UDS                     "_UDS_"
+#ifdef __CYGWIN__
+#define DEFAULT_HOST           "localhost"
+#else
 #define DEFAULT_HOST           UDS
+#endif
 #define DEFAULT_PORT           "citadel"
 
 #include "sysdep.h"
@@ -2820,6 +2824,13 @@ CtdlIPC* CtdlIPC_new(int argc, char **argv, char *hostbuf, char *portbuf)
        strcpy(cithost, DEFAULT_HOST);  /* default host */
        strcpy(citport, DEFAULT_PORT);  /* default port */
 
+       /* Allow caller to supply our values (Windows) */
+       if (hostbuf && strlen(hostbuf) > 0)
+               strcpy(cithost, hostbuf);
+       if (portbuf && strlen(portbuf) > 0)
+               strcpy(citport, portbuf);
+
+       /* Read host/port from command line if present */
        for (a = 0; a < argc; ++a) {
                if (a == 0) {
                        /* do nothing */