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

merovingian: only absolutise dbfarm if it isn't yet already


diffs (45 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
@@ -413,7 +413,7 @@
        err e;
        int argp;
        char *dbfarm = LOCALSTATEDIR "/monetdb5/dbfarm";
-       char *pidfilename;
+       char *pidfilename = NULL;
        char *p;
        FILE *pidfile = NULL;
        char control_usock[1024];
@@ -604,6 +604,15 @@
                                dbfarm, strerror(errno));
                MERO_EXIT_CLEAN(1);
        }
+       /* absolutise dbfarm if it isn't yet (we're in it now) */
+       if (*dbfarm != '/') {
+               dbfarm = alloca(1024);
+               if (getcwd(dbfarm, sizeof(1024)) == NULL) {
+                       Mfprintf(stderr, "could not get dbfarm working 
directory: %s\n",
+                                       strerror(errno));
+                       MERO_EXIT(1);
+               }
+       }
 
        if (_mero_mserver == NULL) {
                _mero_mserver = BINDIR "/mserver5";
@@ -833,15 +842,7 @@
                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);
-       }
+       msab_init(dbfarm, NULL);
 
        unlink(control_usock);
        unlink(mapi_usock);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to