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 <ted.mielczarek@gmail.com>
This commit is contained in:
Mike Frysinger 2019-03-02 01:56:23 -05:00
parent 59d89be2d6
commit 7864f2edaa

View file

@ -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;
}