From 7864f2edaad675f21d87e1f62e5b3e259afae995 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 2 Mar 2019 01:56:23 -0500 Subject: [PATCH] core2md: write error message with perror The current failure message omits the underlying errno. This can make diagnosing failures a bit difficult unless you run everything through strace. For example: $ core2md core /proc/self md $ core2md core /proc/self md Unable to generate minidump Now we get the errno details: Unable to generate minidump: File exists Change-Id: I67f30879868ce4a726d5d888ee8c0a4a316b5186 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1497660 Reviewed-by: Ted Mielczarek --- src/tools/linux/core2md/core2md.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/linux/core2md/core2md.cc b/src/tools/linux/core2md/core2md.cc index a0e8f8ba..c3a9da39 100644 --- a/src/tools/linux/core2md/core2md.cc +++ b/src/tools/linux/core2md/core2md.cc @@ -64,7 +64,7 @@ int main(int argc, char *argv[]) { if (!WriteMinidumpFromCore(minidump_file, core_file, procfs_dir)) { - fprintf(stderr, "Unable to generate minidump.\n"); + perror("core2md: Unable to generate minidump"); return 1; }