Use install path for exec()
authorDavid Goulet <david.goulet@polymtl.ca>
Wed, 20 Jul 2011 20:17:29 +0000 (16:17 -0400)
committerDavid Goulet <david.goulet@polymtl.ca>
Wed, 20 Jul 2011 20:17:29 +0000 (16:17 -0400)
Add INSTALL_PATH define for binary execution path.

Signed-off-by: David Goulet <david.goulet@polymtl.ca>
ltt-sessiond/Makefile.am
ltt-sessiond/main.c
lttng/Makefile.am
lttng/lttng.c

index 13c272a24886d602dd9b92ea975ff3bc26dd61c2..9134a3e95cd7cf85bd2fad0c6018dc45d6f1cf31 100644 (file)
@@ -1,6 +1,8 @@
 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/liblttsessiondcomm \
                          -I$(top_srcdir)/libkernelctl -I$(top_srcdir)/libustctl
 
 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/liblttsessiondcomm \
                          -I$(top_srcdir)/libkernelctl -I$(top_srcdir)/libustctl
 
+INCLUDES = -DINSTALL_PATH=\""$(bindir)"\"
+
 AM_CFLAGS = -fno-strict-aliasing
 
 bin_PROGRAMS = ltt-sessiond
 AM_CFLAGS = -fno-strict-aliasing
 
 bin_PROGRAMS = ltt-sessiond
index 8507523d353ed89aed861fc3daacc4cae7437f76..63e99df386610b79f79e4f618020c9e67964137b 100644 (file)
@@ -914,7 +914,7 @@ static pid_t spawn_kconsumerd(void)
                /*
                 * Exec kconsumerd.
                 */
                /*
                 * Exec kconsumerd.
                 */
-               execlp("ltt-kconsumerd", "ltt-kconsumerd", "--quiet", NULL);
+               execl(INSTALL_PATH "/ltt-kconsumerd", "ltt-kconsumerd", "--quiet", NULL);
                if (errno != 0) {
                        perror("kernel start consumer exec");
                }
                if (errno != 0) {
                        perror("kernel start consumer exec");
                }
index 7a828006b8a6955758678e263bddd1680886c9cc..2efd94e1dba914824be589a1aa2ac4b99a1325f7 100644 (file)
@@ -1,5 +1,7 @@
 AM_CPPFLAGS = -I$(top_srcdir)/include
 
 AM_CPPFLAGS = -I$(top_srcdir)/include
 
+INCLUDES = -DINSTALL_PATH=\""$(bindir)"\"
+
 bin_PROGRAMS = lttng
 
 lttng_SOURCES = cmd.h conf.c conf.h commands/start.c \
 bin_PROGRAMS = lttng
 
 lttng_SOURCES = cmd.h conf.c conf.h commands/start.c \
index 455b18c58108963ef725a35037418d3ffbf0d338..f568933650407693be890e636843effa77af0299 100644 (file)
@@ -336,8 +336,9 @@ static int check_sessiond(void)
 
                /* Let's rock and roll */
                if (pathname == NULL) {
 
                /* Let's rock and roll */
                if (pathname == NULL) {
-                       ret = asprintf(&alloc_pathname, "ltt-sessiond");
+                       ret = asprintf(&alloc_pathname, INSTALL_PATH "/ltt-sessiond");
                        if (ret < 0) {
                        if (ret < 0) {
+                               perror("asprintf spawn sessiond");
                                goto end;
                        }
                        pathname = alloc_pathname;
                                goto end;
                        }
                        pathname = alloc_pathname;
This page took 0.027444 seconds and 4 git commands to generate.