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