summaryrefslogtreecommitdiff
path: root/ltrace-elf.c
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2013-11-11 02:27:33 +0100
committerChanho Park <chanho61.park@samsung.com>2014-08-22 20:38:23 +0900
commitbcc1cb28213a180093ff29714d2baef87ce6a45d (patch)
tree83c81fbba5beb789fa6c6482e84664dafac2cf30 /ltrace-elf.c
parentd0d40630b921a3b54c35ff38be6f8e3fb13061cb (diff)
downloadltrace-bcc1cb28213a180093ff29714d2baef87ce6a45d.tar.gz
ltrace-bcc1cb28213a180093ff29714d2baef87ce6a45d.tar.bz2
ltrace-bcc1cb28213a180093ff29714d2baef87ce6a45d.zip
Add error message if ltelf_init fails to open ELF
Diffstat (limited to 'ltrace-elf.c')
-rw-r--r--ltrace-elf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ltrace-elf.c b/ltrace-elf.c
index 6f86d56..8997518 100644
--- a/ltrace-elf.c
+++ b/ltrace-elf.c
@@ -361,8 +361,11 @@ ltelf_init(struct ltelf *lte, const char *filename)
{
memset(lte, 0, sizeof *lte);
lte->fd = open(filename, O_RDONLY);
- if (lte->fd == -1)
+ if (lte->fd == -1) {
+ fprintf(stderr, "Can't open %s: %s\n", filename,
+ strerror(errno));
return 1;
+ }
elf_version(EV_CURRENT);