Blame SOURCES/ltrace-0.7.91-cant_open.patch

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