From 0d9268cdbc26e0827da55aec1a89387d79f917cf Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Wed, 27 Jan 2021 23:32:03 +0000 Subject: [PATCH] Don't exit when ivl_root not found - the user may have supplied it. When running 'make check' without having an installed copy, find_ivl_root() will fail on Unix systems that don't provide /proc/self/exe (e.g. MacOS). (cherry picked from commit 56d2d798ecd97c09539e7748997013eddd37ab42) --- driver/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/driver/main.c b/driver/main.c index e1d6bead7..aabd04c78 100644 --- a/driver/main.c +++ b/driver/main.c @@ -1061,7 +1061,11 @@ static void find_ivl_root(void) find_ivl_root_failed("command path exceeds size of string buffer."); } if (len <= 0) { - find_ivl_root_failed("couldn't get command path from OS."); + // We've failed, but we may yet find a -B option on the command line. + // Use the built-in path so the user sees a sensible error message. + assert(strlen(IVL_ROOT) < sizeof ivl_root); + strcpy(ivl_root, IVL_ROOT); + return; } s = strrchr(ivl_root, sep); if (s == 0) {