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