chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
systemctl: introduce -r switch to show units running in local containers in addition...
[elogind.git]
/
src
/
journal
/
coredumpctl.c
diff --git
a/src/journal/coredumpctl.c
b/src/journal/coredumpctl.c
index bcfee46da1d989b273f77ec14a911d50c40758de..3bceb48ff731351afb2dff3c9d9d675ad4da44e6 100644
(file)
--- a/
src/journal/coredumpctl.c
+++ b/
src/journal/coredumpctl.c
@@
-126,10
+126,11
@@
static int add_match(Set *set, const char *match) {
goto fail;
log_debug("Adding pattern: %s", pattern);
goto fail;
log_debug("Adding pattern: %s", pattern);
- r = set_
consume
(set, pattern);
+ r = set_
put
(set, pattern);
if (r < 0) {
log_error("Failed to add pattern '%s': %s",
pattern, strerror(-r));
if (r < 0) {
log_error("Failed to add pattern '%s': %s",
pattern, strerror(-r));
+ free(pattern);
goto fail;
}
goto fail;
}
@@
-214,7
+215,7
@@
static int parse_argv(int argc, char *argv[], Set *matches) {
if (optind < argc) {
const char *cmd = argv[optind++];
if (optind < argc) {
const char *cmd = argv[optind++];
- if(streq(cmd, "list"))
+ if
(streq(cmd, "list"))
arg_action = ACTION_LIST;
else if (streq(cmd, "dump"))
arg_action = ACTION_DUMP;
arg_action = ACTION_LIST;
else if (streq(cmd, "dump"))
arg_action = ACTION_DUMP;
@@
-416,7
+417,7
@@
static int dump_core(sd_journal* j) {
r = sd_journal_previous(j);
if (r >= 0)
r = sd_journal_previous(j);
if (r >= 0)
- log_warning("More than one entry matches, ignoring rest.
\n
");
+ log_warning("More than one entry matches, ignoring rest.");
return 0;
}
return 0;
}
@@
-471,7
+472,7
@@
static int run_gdb(sd_journal *j) {
data = (const uint8_t*) data + 9;
len -= 9;
data = (const uint8_t*) data + 9;
len -= 9;
- fd = mkostemp
(path, O_WRONLY
);
+ fd = mkostemp
_safe(path, O_WRONLY|O_CLOEXEC
);
if (fd < 0) {
log_error("Failed to create temporary file: %m");
return -errno;
if (fd < 0) {
log_error("Failed to create temporary file: %m");
return -errno;
@@
-479,7
+480,7
@@
static int run_gdb(sd_journal *j) {
sz = write(fd, data, len);
if (sz < 0) {
sz = write(fd, data, len);
if (sz < 0) {
- log_error("Failed to write temporary file: %
s", strerror(errno)
);
+ log_error("Failed to write temporary file: %
m"
);
r = -errno;
goto finish;
}
r = -errno;
goto finish;
}