Add error message if ltelf_init fails to open ELF
authorPetr Machata <pmachata@redhat.com>
Mon, 11 Nov 2013 01:27:33 +0000 (02:27 +0100)
committerChanho Park <chanho61.park@samsung.com>
Fri, 22 Aug 2014 11:38:23 +0000 (20:38 +0900)
ltrace-elf.c

index 6f86d56ae2885df2cd15925f7e3bb6e49a8f971f..8997518412645b5fd2b8f622f32e535c674fde13 100644 (file)
@@ -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);