From 1055a181ad24dad9ef8d1482452fd4aff92df706 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 10 Feb 2009 04:10:34 +0000 Subject: include more info in error messages so we have a better idea where things are failing --- utils/ldd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/ldd.c b/utils/ldd.c index 18f4b6cde..1f1dc2516 100644 --- a/utils/ldd.c +++ b/utils/ldd.c @@ -339,7 +339,7 @@ static void search_for_named_library(char *name, char *result, /* We need a writable copy of this string */ path = strdup(path_list); if (!path) { - fprintf(stderr, "Out of memory!\n"); + fprintf(stderr, "%s: Out of memory!\n", __func__); exit(EXIT_FAILURE); } /* Eliminate all double //s */ @@ -388,7 +388,7 @@ void locate_library_file(ElfW(Ehdr) *ehdr, ElfW(Dyn) *dynamic, int is_suid, /* We need some elbow room here. Make some room... */ buf = malloc(1024); if (!buf) { - fprintf(stderr, "Out of memory!\n"); + fprintf(stderr, "%s: Out of memory!\n", __func__); exit(EXIT_FAILURE); } @@ -645,7 +645,7 @@ int find_dependancies(char *filename) ehdr = mmap(0, statbuf.st_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fileno(thefile), 0); if (ehdr == MAP_FAILED) { fclose(thefile); - fprintf(stderr, "Out of memory!\n"); + fprintf(stderr, "mmap(%s) failed: %s\n", filename, strerror(errno)); return -1; } -- cgit v1.2.3