Changeset: fa081ca22413 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fa081ca22413
Modified Files:
        tools/merovingian/daemon/merovingian.c
Branch: default
Log Message:

merovingian: retrieve cwd for gdk_dbfarm

GDK doesn't like a relative dbfarm ("."), so we need to pass an
absolute location to it.  Retrieve it, and give it to sabaoth, which in
turn will give it to mserver in fork_mserver.

This fixes bug #2787


diffs (34 lines):

diff --git a/tools/merovingian/daemon/merovingian.c 
b/tools/merovingian/daemon/merovingian.c
--- a/tools/merovingian/daemon/merovingian.c
+++ b/tools/merovingian/daemon/merovingian.c
@@ -816,6 +816,19 @@
                MERO_EXIT(1);
        }
 
+       {
+               char cwd[1024];
+               if (getcwd(cwd, sizeof(cwd)) == NULL) {
+                       Mfprintf(stderr, "could not get current working 
directory: %s\n",
+                                       strerror(errno));
+                       MERO_EXIT(1);
+               }
+               msab_init(cwd, NULL);
+       }
+
+       unlink(control_usock);
+       unlink(mapi_usock);
+
        /* write out the pid */
        Mfprintf(pidfile, "%d\n", (int)d->pid);
        fclose(pidfile);
@@ -824,10 +837,6 @@
                        MERO_VERSION, MONETDB_RELEASE);
        Mfprintf(stdout, "monitoring dbfarm %s\n", dbfarm);
 
-       msab_init(".", NULL);
-       unlink(control_usock);
-       unlink(mapi_usock);
-
        /* open up connections */
        if (
                        (e = openConnectionTCP(&sock, port, stdout)) == NO_ERR 
&&
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to