sessiond: Move trace_ust_clock to a clock_attributes_sample class
[lttng-tools.git] / src / bin / lttng-crash / lttng-crash.cpp
index 0b4afc91bdfa49a95ed980fcd33f25cf3b627de4..3987a60ddac334d2e75fabf213102c7d4d1ea0f6 100644 (file)
@@ -98,6 +98,7 @@ enum rb_modes {
        RING_BUFFER_DISCARD = 1,        /* Discard when buffer full */
 };
 
+namespace {
 struct crash_abi_unknown {
        uint8_t magic[RB_CRASH_DUMP_ABI_MAGIC_LEN];
        uint64_t mmap_length;   /* Overall length of crash record */
@@ -177,6 +178,7 @@ struct lttng_crash_layout {
        uint64_t num_subbuf;    /* Number of sub-buffers for writer */
        uint32_t mode;          /* Buffer mode: 0: overwrite, 1: discard */
 };
+} /* namespace */
 
 /* Variables */
 static const char *progname;
@@ -781,7 +783,7 @@ int copy_crash_data(const struct lttng_crash_layout *layout, int fd_dest,
                return ret;
        }
        src_file_len = layout->mmap_length;
-       buf = (char *) zmalloc(src_file_len);
+       buf = calloc<char>(src_file_len);
        if (!buf) {
                return -1;
        }
@@ -1129,7 +1131,7 @@ int delete_dir_recursive(const char *path)
                }
 
                if (S_ISDIR(st.st_mode)) {
-                       char *subpath = (char *) zmalloc(PATH_MAX);
+                       char *subpath = calloc<char>(PATH_MAX);
 
                        if (!subpath) {
                                PERROR("zmalloc path");
This page took 0.023455 seconds and 4 git commands to generate.