Blame SOURCES/ltrace-0.7.91-cant_open.patch
|
|
71a0ac |
diff -urp ltrace-0.7.91/libltrace.c master/libltrace.c
|
|
|
71a0ac |
--- ltrace-0.7.91/libltrace.c 2014-01-14 16:31:37.696174464 +0100
|
|
|
71a0ac |
+++ master/libltrace.c 2013-11-21 14:06:38.623701688 +0100
|
|
|
71a0ac |
@@ -113,9 +117,13 @@ ltrace_init(int argc, char **argv) {
|
|
|
71a0ac |
if (command) {
|
|
|
71a0ac |
/* Check that the binary ABI is supported before
|
|
|
71a0ac |
* calling execute_program. */
|
|
|
71a0ac |
- struct ltelf lte;
|
|
|
71a0ac |
- ltelf_init(<e, command);
|
|
|
71a0ac |
- ltelf_destroy(<e;;
|
|
|
71a0ac |
+ {
|
|
|
71a0ac |
+ struct ltelf lte;
|
|
|
71a0ac |
+ if (ltelf_init(<e, command) == 0)
|
|
|
71a0ac |
+ ltelf_destroy(<e;;
|
|
|
71a0ac |
+ else
|
|
|
71a0ac |
+ exit(EXIT_FAILURE);
|
|
|
71a0ac |
+ }
|
|
|
71a0ac |
|
|
|
71a0ac |
pid_t pid = execute_program(command, argv);
|
|
|
71a0ac |
struct process *proc = open_program(command, pid);
|
|
|
71a0ac |
diff -urp ltrace-0.7.91/ltrace-elf.c master/ltrace-elf.c
|
|
|
71a0ac |
--- ltrace-0.7.91/ltrace-elf.c 2014-01-14 16:31:37.688174420 +0100
|
|
|
71a0ac |
+++ master/ltrace-elf.c 2013-11-22 18:17:11.767721609 +0100
|
|
|
71a0ac |
@@ -361,8 +361,11 @@ ltelf_init(struct ltelf *lte, const char
|
|
|
71a0ac |
{
|
|
|
71a0ac |
memset(lte, 0, sizeof *lte);
|
|
|
71a0ac |
lte->fd = open(filename, O_RDONLY);
|
|
|
71a0ac |
- if (lte->fd == -1)
|
|
|
71a0ac |
+ if (lte->fd == -1) {
|
|
|
71a0ac |
+ fprintf(stderr, "Can't open %s: %s\n", filename,
|
|
|
71a0ac |
+ strerror(errno));
|
|
|
71a0ac |
return 1;
|
|
|
71a0ac |
+ }
|
|
|
71a0ac |
|
|
|
71a0ac |
elf_version(EV_CURRENT);
|
|
|
71a0ac |
|