Changeset: 9e227ca0b948 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9e227ca0b948
Modified Files:
tools/mserver/mserver5.c
Branch: Dec2025
Log Message:
If get_bin_path returns a non-existent path and argv[0] does exist, use it.
This can happen if mserver5 is run under valgrind. In that case,
get_bin_path returns $PWD/mserver5 as binary, but that isn't where the
binary is located (usually). This does mean you have to provide the
full path of the mserver5 binary to valgrind and not depend on it
searching $PATH.
This fixes bug #7798.
diffs (14 lines):
diff --git a/tools/mserver/mserver5.c b/tools/mserver/mserver5.c
--- a/tools/mserver/mserver5.c
+++ b/tools/mserver/mserver5.c
@@ -753,6 +753,10 @@ main(int argc, char **av)
};
struct stat sb;
if (binpath != NULL) {
+ if (MT_stat(binpath, &sb) != 0 &&
+ MT_stat(av[0], &sb) == 0 &&
+ MT_path_absolute(av[0]))
+ binpath = av[0];
char *p = strrchr(binpath, DIR_SEP);
if (p != NULL)
*p = '\0';
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]