chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
2cf4172
)
journalctl: static variables immediately configured via command line arguments should...
author
Lennart Poettering
<lennart@poettering.net>
Mon, 5 Jan 2015 00:08:51 +0000
(
01:08
+0100)
committer
Lennart Poettering
<lennart@poettering.net>
Mon, 5 Jan 2015 00:40:51 +0000
(
01:40
+0100)
src/journal/coredumpctl.c
patch
|
blob
|
history
diff --git
a/src/journal/coredumpctl.c
b/src/journal/coredumpctl.c
index 8ebca4f5161ff68693778fba0a9597f24bd60da4..756e793a4fed14bea20771f5e38ed7a8248fae44 100644
(file)
--- a/
src/journal/coredumpctl.c
+++ b/
src/journal/coredumpctl.c
@@
-50,8
+50,7
@@
static const char* arg_field = NULL;
static int arg_no_pager = false;
static int arg_no_legend = false;
static int arg_one = false;
static int arg_no_pager = false;
static int arg_no_legend = false;
static int arg_one = false;
-
-static FILE* output = NULL;
+static FILE* arg_output = NULL;
static Set *new_matches(void) {
Set *set;
static Set *new_matches(void) {
Set *set;
@@
-184,13
+183,13
@@
static int parse_argv(int argc, char *argv[], Set *matches) {
break;
case 'o':
break;
case 'o':
- if (output) {
+ if (
arg_
output) {
log_error("cannot set output more than once");
return -EINVAL;
}
log_error("cannot set output more than once");
return -EINVAL;
}
- output = fopen(optarg, "we");
- if (!output)
+
arg_
output = fopen(optarg, "we");
+ if (!
arg_
output)
return log_error_errno(errno, "writing to '%s': %m", optarg);
break;
return log_error_errno(errno, "writing to '%s': %m", optarg);
break;
@@
-687,14
+686,14
@@
static int dump_core(sd_journal* j) {
if (r < 0)
return r;
if (r < 0)
return r;
- print_info(output ? stdout : stderr, j, false);
+ print_info(
arg_
output ? stdout : stderr, j, false);
- if (on_tty() && !output) {
+ if (on_tty() && !
arg_
output) {
log_error("Refusing to dump core to tty.");
return -ENOTTY;
}
log_error("Refusing to dump core to tty.");
return -ENOTTY;
}
- r = save_core(j,
output ? fileno(
output) : STDOUT_FILENO, NULL, NULL);
+ r = save_core(j,
arg_output ? fileno(arg_
output) : STDOUT_FILENO, NULL, NULL);
if (r < 0)
return log_error_errno(r, "Coredump retrieval failed: %m");
if (r < 0)
return log_error_errno(r, "Coredump retrieval failed: %m");
@@
-855,8
+854,8
@@
int main(int argc, char *argv[]) {
end:
pager_close();
end:
pager_close();
- if (output)
- fclose(output);
+ if (
arg_
output)
+ fclose(
arg_
output);
return r >= 0 ? r : EXIT_FAILURE;
}
return r >= 0 ? r : EXIT_FAILURE;
}