Blame SOURCES/ltrace-0.7.91-cant_open.patch

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