chiark / gitweb /
dbus: introduce _cleanup_dbus_error_free_
[elogind.git] / src / journal / coredumpctl.c
index bdea8ed057828a74dcd6cfae0c6e76d58679c2ae..f9cebb7a423dbb4b225b20b283b4684fc8e1f0f9 100644 (file)
@@ -19,6 +19,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <locale.h>
 #include <stdio.h>
 #include <string.h>
 #include <getopt.h>
@@ -341,6 +342,11 @@ static int dump_list(sd_journal *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);
@@ -380,6 +386,9 @@ static int dump_core(sd_journal* j) {
 
         assert(j);
 
+        /* We want full data, nothing truncated. */
+        sd_journal_set_data_threshold(j, 0);
+
         r = focus(j);
         if (r < 0)
                 return r;
@@ -427,6 +436,8 @@ static int run_gdb(sd_journal *j) {
 
         assert(j);
 
+        sd_journal_set_data_threshold(j, 0);
+
         r = focus(j);
         if (r < 0)
                 return r;
@@ -514,6 +525,7 @@ int main(int argc, char *argv[]) {
         Iterator it;
         int r = 0;
 
+        setlocale(LC_ALL, "");
         log_parse_environment();
         log_open();