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 */
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;
return ret;
}
src_file_len = layout->mmap_length;
- buf = (char *) zmalloc(src_file_len);
+ buf = calloc<char>(src_file_len);
if (!buf) {
return -1;
}
}
if (S_ISDIR(st.st_mode)) {
- char *subpath = (char *) zmalloc(PATH_MAX);
+ char *subpath = calloc<char>(PATH_MAX);
if (!subpath) {
PERROR("zmalloc path");