Changeset: 30099e750627 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=30099e750627
Modified Files:
        gdk/gdk_logger.c
Branch: transaction-replication
Log Message:

Handle correctly the default case - if the logdir path is not absolute


diffs (22 lines):

diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -1065,9 +1065,15 @@ logger_new(int debug, char *fn, logger_s
        lg->read32bitoid = 0;
 #endif
 
-       snprintf(filename, BUFSIZ, "%s%c%s%c%s%c",
-                GDKgetenv("gdk_dbpath"), DIR_SEP,
-                log_settings->logdir, DIR_SEP, fn, DIR_SEP);
+       /* if the logdir path is absolute, do not prefix it with the gdk_dbpath 
*/
+       if (MT_path_absolute(log_settings->logdir)) {
+               snprintf(filename, BUFSIZ, "%s%c%s%c%s%c",
+                               log_settings->logdir, DIR_SEP, fn, DIR_SEP);
+       } else {
+               snprintf(filename, BUFSIZ, "%s%c%s%c%s%c",
+                               GDKgetenv("gdk_dbpath"), DIR_SEP,
+                               log_settings->logdir, DIR_SEP, fn, DIR_SEP);
+       }
        if ((lg->fn = GDKstrdup(fn)) == NULL ||
            (lg->dir = GDKstrdup(filename)) == NULL) {
                fprintf(stderr, "!ERROR: logger_new: strdup failed\n");
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to