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