along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <locale.h>
#include <stdio.h>
#include <string.h>
#include <getopt.h>
"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"
" dump PATH Print coredump to stdout\n"
case ARG_VERSION:
puts(PACKAGE_STRING);
- puts(DISTRIBUTION);
puts(SYSTEMD_FEATURES);
arg_action = ACTION_NONE;
return 0;
return 0;
*var = strndup((const char*)data + ident, len - ident);
- if (!var)
+ if (!*var)
return log_oom();
return 0;
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);
assert(j);
+ /* We want full data, nothing truncated. */
+ sd_journal_set_data_threshold(j, 0);
+
r = focus(j);
if (r < 0)
return r;
assert(j);
+ sd_journal_set_data_threshold(j, 0);
+
r = focus(j);
if (r < 0)
return r;
Iterator it;
int r = 0;
+ setlocale(LC_ALL, "");
log_parse_environment();
log_open();