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