summaryrefslogtreecommitdiff
path: root/libdwfl/argp-std.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2009-01-05 23:59:32 -0800
committerRoland McGrath <roland@redhat.com>2009-01-05 23:59:32 -0800
commitbca43152aa0bcb31b9442c407bf2b86379761c50 (patch)
tree50751cde17184a37e7439b6dde15dbb48a4d1fea /libdwfl/argp-std.c
parent92287fdf5b21438a3aa3d7094527b5cf870d1af6 (diff)
downloadelfutils-bca43152aa0bcb31b9442c407bf2b86379761c50.tar.gz
libdwfl automagic decompression support
Diffstat (limited to 'libdwfl/argp-std.c')
-rw-r--r--libdwfl/argp-std.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libdwfl/argp-std.c b/libdwfl/argp-std.c
index 0a0f7ebf..ce2e20a4 100644
--- a/libdwfl/argp-std.c
+++ b/libdwfl/argp-std.c
@@ -1,5 +1,5 @@
/* Standard argp argument parsers for tools using libdwfl.
- Copyright (C) 2005, 2007, 2008 Red Hat, Inc.
+ Copyright (C) 2005, 2007, 2008, 2009 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -215,14 +215,14 @@ parse_opt (int key, char *arg, struct argp_state *state)
if (fd < 0)
goto nofile;
- Elf *core = elf_begin (fd, ELF_C_READ_MMAP_PRIVATE, NULL);
- if (core == NULL)
+ Elf *core;
+ Dwfl_Error error = __libdw_open_file (&fd, &core, true, false);
+ if (error != DWFL_E_NOERROR)
{
- close (fd);
argp_failure (state, EXIT_FAILURE, 0,
_("cannot read ELF core file: %s"),
- elf_errmsg (-1));
- return EIO;
+ INTUSE(dwfl_errmsg) (error));
+ return error == DWFL_E_ERRNO ? errno : EIO;
}
GElf_Ehdr ehdr;