chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
pager: introduce "jump to end" option
[elogind.git]
/
src
/
journal
/
coredumpctl.c
diff --git
a/src/journal/coredumpctl.c
b/src/journal/coredumpctl.c
index 663e3cdd10391d3e66c45ccce2e86569f5822ea5..8bfab0075f5438ee7ad79d080203455f253b4fc3 100644
(file)
--- a/
src/journal/coredumpctl.c
+++ b/
src/journal/coredumpctl.c
@@
-19,6
+19,7
@@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <locale.h>
#include <stdio.h>
#include <string.h>
#include <getopt.h>
#include <stdio.h>
#include <string.h>
#include <getopt.h>
@@
-87,6
+88,7
@@
static int help(void) {
"Commands:\n"
" -h --help Show this help\n"
" --version Print version string\n"
"Commands:\n"
" -h --help Show this help\n"
" --version Print version string\n"
+ " -F --field=FIELD List all values a certain field takes\n"
" gdb Start gdb for the first matching coredump\n"
" list List available coredumps\n"
" dump PID Print coredump to stdout\n"
" gdb Start gdb for the first matching coredump\n"
" list List available coredumps\n"
" dump PID Print coredump to stdout\n"
@@
-168,7
+170,6
@@
static int parse_argv(int argc, char *argv[]) {
case ARG_VERSION:
puts(PACKAGE_STRING);
case ARG_VERSION:
puts(PACKAGE_STRING);
- puts(DISTRIBUTION);
puts(SYSTEMD_FEATURES);
arg_action = ACTION_NONE;
return 0;
puts(SYSTEMD_FEATURES);
arg_action = ACTION_NONE;
return 0;
@@
-260,7
+261,7
@@
static int retrieve(const void *data,
return 0;
*var = strndup((const char*)data + ident, len - ident);
return 0;
*var = strndup((const char*)data + ident, len - ident);
- if (!var)
+ if (!
*
var)
return log_oom();
return 0;
return log_oom();
return 0;
@@
-340,6
+341,11
@@
static int dump_list(sd_journal *j) {
assert(j);
assert(j);
+ /* The coredumps are likely to compressed, and for just
+ * listing them we don#t need to decompress them, so let's
+ * pick a fairly low data threshold here */
+ sd_journal_set_data_threshold(j, 4096);
+
SD_JOURNAL_FOREACH(j) {
if (field)
print_field(stdout, j);
SD_JOURNAL_FOREACH(j) {
if (field)
print_field(stdout, j);
@@
-379,6
+385,9
@@
static int dump_core(sd_journal* j) {
assert(j);
assert(j);
+ /* We want full data, nothing truncated. */
+ sd_journal_set_data_threshold(j, 0);
+
r = focus(j);
if (r < 0)
return r;
r = focus(j);
if (r < 0)
return r;
@@
-426,6
+435,8
@@
static int run_gdb(sd_journal *j) {
assert(j);
assert(j);
+ sd_journal_set_data_threshold(j, 0);
+
r = focus(j);
if (r < 0)
return r;
r = focus(j);
if (r < 0)
return r;
@@
-513,6
+524,7
@@
int main(int argc, char *argv[]) {
Iterator it;
int r = 0;
Iterator it;
int r = 0;
+ setlocale(LC_ALL, "");
log_parse_environment();
log_open();
log_parse_environment();
log_open();
@@
-548,7
+560,7
@@
int main(int argc, char *argv[]) {
case ACTION_LIST:
if (!arg_no_pager)
case ACTION_LIST:
if (!arg_no_pager)
- pager_open();
+ pager_open(
false
);
r = dump_list(j);
break;
r = dump_list(j);
break;