Blame SOURCES/ltrace-0.7.91-cant_open.patch

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