aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2010-06-07 04:48:14 -0400
committerSteven Rostedt <rostedt@goodmis.org>2010-06-07 10:04:53 -0400
commitb31973ab0712758efc041c1ce09bc1fa6bc9fc67 (patch)
treebee3dd3f3868d88819c67f9b7db8c59ae2b9389b
parent7efc6c46b8eddf711060c542df17b9269d559db4 (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--Makefile4
-rw-r--r--plugin_python.c4
-rw-r--r--trace-util.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index a1096f2..1ad0859 100644
--- a/Makefile
+++ b/Makefile
@@ -32,8 +32,8 @@ python_dir = $(HOME)/.trace-cmd/python
32else 32else
33plugin_dir = $(prefix)/share/trace-cmd/plugins 33plugin_dir = $(prefix)/share/trace-cmd/plugins
34python_dir = $(prefix)/share/trace-cmd/python 34python_dir = $(prefix)/share/trace-cmd/python
35PLUGIN_DIR = -DPLUGIN_DIR=$(plugin_dir) 35PLUGIN_DIR = -DPLUGIN_DIR="$(plugin_dir)"
36PYTHON_DIR = -DPYTHON_DIR=$(python_dir) 36PYTHON_DIR = -DPYTHON_DIR="$(python_dir)"
37PLUGIN_DIR_SQ = '$(subst ','\'',$(PLUGIN_DIR))' 37PLUGIN_DIR_SQ = '$(subst ','\'',$(PLUGIN_DIR))'
38PYTHON_DIR_SQ = '$(subst ','\'',$(PYTHON_DIR))' 38PYTHON_DIR_SQ = '$(subst ','\'',$(PYTHON_DIR))'
39endif 39endif
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
9static const char pypath[] = 9static 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
13static const char pyload[] = 13static 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