Changeset: 8204332fba2e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8204332fba2e
Modified Files:
        monetdb5/mal/mal_readline.c
        tools/mserver/mserver5.c
Branch: port-monetdblite
Log Message:

Create database directory after BBPaddfarm.

This prevents from triggering the !GDKinmemory() assertion in GDKcreatedir.

Also read from GDKstdin instead of GDKin in mal_readline (GDKstdin is set to 
stdin globally).


diffs (34 lines):

diff --git a/monetdb5/mal/mal_readline.c b/monetdb5/mal/mal_readline.c
--- a/monetdb5/mal/mal_readline.c
+++ b/monetdb5/mal/mal_readline.c
@@ -50,7 +50,7 @@ getConsoleInput(Client c, const char *pr
                                return NULL;
                        }
                }
-               if (mnstr_read(GDKin, buf, 1, BUFSIZ) > 0)
+               if (mnstr_read(GDKstdin, buf, 1, BUFSIZ) > 0)
                        line = buf;
                else
                        line = NULL;
diff --git a/tools/mserver/mserver5.c b/tools/mserver/mserver5.c
--- a/tools/mserver/mserver5.c
+++ b/tools/mserver/mserver5.c
@@ -484,13 +484,17 @@ main(int argc, char **av)
        monet_script[i] = NULL;
        if (!dbpath) {
                dbpath = absolute_path(mo_find_option(set, setlen, 
"gdk_dbpath"));
-               if (dbpath == NULL || GDKcreatedir(dbpath) != GDK_SUCCEED) {
+               if (!dbpath) {
                        mnstr_printf(GDKerr, "!ERROR: cannot allocate memory 
for database directory \n");
                        exit(1);
                }
        }
        BBPaddfarm(dbpath, 1 << PERSISTENT);
        BBPaddfarm(dbextra ? dbextra : dbpath, 1 << TRANSIENT);
+       if (GDKcreatedir(dbpath) != GDK_SUCCEED) {
+               mnstr_printf(GDKerr, "!ERROR: cannot create database directory 
\n");
+               exit(1);
+       }
        GDKfree(dbpath);
        if (monet_init(set, setlen) == 0) {
                mo_free_options(set, setlen);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to