Blame SOURCES/ltrace-0.7.91-cant_open.patch

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