From aa4e4813f3410c866cf8dbc42f6eaa038d704a22 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 3 Sep 2021 17:31:29 -0400 Subject: [PATCH] bin: compile lttng-crash as a C++ MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Same as the previous commits, but change lttng-crash to be a C++ program. Change-Id: Ia487e12d2db07e2cd091637d38669289bcaff5d4 Signed-off-by: Simon Marchi Signed-off-by: Jérémie Galarneau --- src/bin/lttng-crash/Makefile.am | 2 +- src/bin/lttng-crash/{lttng-crash.c => lttng-crash.cpp} | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename src/bin/lttng-crash/{lttng-crash.c => lttng-crash.cpp} (99%) diff --git a/src/bin/lttng-crash/Makefile.am b/src/bin/lttng-crash/Makefile.am index 9c320bb15..b4231f3e9 100644 --- a/src/bin/lttng-crash/Makefile.am +++ b/src/bin/lttng-crash/Makefile.am @@ -8,7 +8,7 @@ endif bin_PROGRAMS = lttng-crash -lttng_crash_SOURCES = lttng-crash.c +lttng_crash_SOURCES = lttng-crash.cpp lttng_crash_LDADD = $(top_builddir)/src/common/libcommon.la \ $(top_builddir)/src/common/config/libconfig.la diff --git a/src/bin/lttng-crash/lttng-crash.c b/src/bin/lttng-crash/lttng-crash.cpp similarity index 99% rename from src/bin/lttng-crash/lttng-crash.c rename to src/bin/lttng-crash/lttng-crash.cpp index a4b6a93f8..3f5ea3759 100644 --- a/src/bin/lttng-crash/lttng-crash.c +++ b/src/bin/lttng-crash/lttng-crash.cpp @@ -511,7 +511,7 @@ int get_crash_layout(struct lttng_crash_layout *layout, int fd, RB_CRASH_DUMP_ABI_LEN); return -1; } - map = mmap(NULL, RB_CRASH_DUMP_ABI_LEN, PROT_READ, MAP_PRIVATE, + map = (char *) mmap(NULL, RB_CRASH_DUMP_ABI_LEN, PROT_READ, MAP_PRIVATE, fd, 0); if (map == MAP_FAILED) { PERROR("Mapping file"); @@ -781,7 +781,7 @@ int copy_crash_data(const struct lttng_crash_layout *layout, int fd_dest, return ret; } src_file_len = layout->mmap_length; - buf = zmalloc(src_file_len); + buf = (char *) zmalloc(src_file_len); if (!buf) { return -1; } @@ -1129,7 +1129,7 @@ int delete_dir_recursive(const char *path) } if (S_ISDIR(st.st_mode)) { - char *subpath = zmalloc(PATH_MAX); + char *subpath = (char *) zmalloc(PATH_MAX); if (!subpath) { PERROR("zmalloc path"); -- 2.34.1