diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2010-06-07 04:48:14 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-06-07 10:04:53 -0400 |
commit | b31973ab0712758efc041c1ce09bc1fa6bc9fc67 (patch) | |
tree | bee3dd3f3868d88819c67f9b7db8c59ae2b9389b | |
parent | 7efc6c46b8eddf711060c542df17b9269d559db4 (diff) |
trace-cmd: quote path definitions
Rather than using MAKE_STR(), quote path definitions on the command
line so that the preprocessor sees a string already. This avoids problems
with path names that aren't valid expressions.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | plugin_python.c | 4 | ||||
-rw-r--r-- | trace-util.c | 2 |
3 files changed, 5 insertions, 5 deletions
@@ -32,8 +32,8 @@ python_dir = $(HOME)/.trace-cmd/python | |||
32 | else | 32 | else |
33 | plugin_dir = $(prefix)/share/trace-cmd/plugins | 33 | plugin_dir = $(prefix)/share/trace-cmd/plugins |
34 | python_dir = $(prefix)/share/trace-cmd/python | 34 | python_dir = $(prefix)/share/trace-cmd/python |
35 | PLUGIN_DIR = -DPLUGIN_DIR=$(plugin_dir) | 35 | PLUGIN_DIR = -DPLUGIN_DIR="$(plugin_dir)" |
36 | PYTHON_DIR = -DPYTHON_DIR=$(python_dir) | 36 | PYTHON_DIR = -DPYTHON_DIR="$(python_dir)" |
37 | PLUGIN_DIR_SQ = '$(subst ','\'',$(PLUGIN_DIR))' | 37 | PLUGIN_DIR_SQ = '$(subst ','\'',$(PLUGIN_DIR))' |
38 | PYTHON_DIR_SQ = '$(subst ','\'',$(PYTHON_DIR))' | 38 | PYTHON_DIR_SQ = '$(subst ','\'',$(PYTHON_DIR))' |
39 | endif | 39 | endif |
diff --git a/plugin_python.c b/plugin_python.c index 74a4cfe..4212cde 100644 --- a/plugin_python.c +++ b/plugin_python.c | |||
@@ -3,12 +3,12 @@ | |||
3 | #include "trace-cmd.h" | 3 | #include "trace-cmd.h" |
4 | 4 | ||
5 | #ifndef PYTHON_DIR | 5 | #ifndef PYTHON_DIR |
6 | #define PYTHON_DIR . | 6 | #define PYTHON_DIR "." |
7 | #endif | 7 | #endif |
8 | 8 | ||
9 | static const char pypath[] = | 9 | static const char pypath[] = |
10 | "import sys\n" | 10 | "import sys\n" |
11 | "sys.path.append(\"" MAKE_STR(PYTHON_DIR) "\")\n"; | 11 | "sys.path.append(\"" PYTHON_DIR "\")\n"; |
12 | 12 | ||
13 | static const char pyload[] = | 13 | static const char pyload[] = |
14 | "import imp, tracecmd, ctracecmd\n" | 14 | "import imp, tracecmd, ctracecmd\n" |
diff --git a/trace-util.c b/trace-util.c index fba6a8d..6605f1f 100644 --- a/trace-util.c +++ b/trace-util.c | |||
@@ -354,7 +354,7 @@ void trace_util_load_plugins(struct pevent *pevent, const char *suffix, | |||
354 | /* If a system plugin directory was defined, check that first */ | 354 | /* If a system plugin directory was defined, check that first */ |
355 | #ifdef PLUGIN_DIR | 355 | #ifdef PLUGIN_DIR |
356 | if (!tracecmd_disable_sys_plugins) | 356 | if (!tracecmd_disable_sys_plugins) |
357 | trace_util_load_plugins_dir(pevent, suffix, MAKE_STR(PLUGIN_DIR), | 357 | trace_util_load_plugins_dir(pevent, suffix, PLUGIN_DIR, |
358 | load_plugin, data); | 358 | load_plugin, data); |
359 | #endif | 359 | #endif |
360 | 360 | ||