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