From a929fd0f0a377972e62212f5ea3b18983192a998 Mon Sep 17 00:00:00 2001 From: Zhaolei Date: Mon, 2 Jun 2008 11:20:56 +0800 Subject: Fix the problem that kernel module compile failure when runtime directory is set to relative path(stap -R). --- main.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'main.cxx') diff --git a/main.cxx b/main.cxx index b7eac167..7b5decd8 100644 --- a/main.cxx +++ b/main.cxx @@ -662,6 +662,16 @@ main (int argc, char * const argv []) usage(s, 1); } + // translate path of runtime to absolute path + if (s.runtime_path[0] != '/') + { + char cwd[PATH_MAX]; + if (getcwd(cwd, sizeof(cwd))) + { + s.runtime_path = string(cwd) + "/" + s.runtime_path; + } + } + int rc = 0; // override PATH and LC_ALL -- cgit