Mesa (master): amd: Replace vasprintf with vfprintf

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Nov 28 05:32:02 UTC 2020


Module: Mesa
Branch: master
Commit: 740490787093ba3ce223485059052045b2ad958d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=740490787093ba3ce223485059052045b2ad958d

Author: James Park <jpark37 at lagfreegames.com>
Date:   Thu Nov 26 20:41:35 2020 -0800

amd: Replace vasprintf with vfprintf

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7791>

---

 src/amd/common/ac_rtld.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/amd/common/ac_rtld.c b/src/amd/common/ac_rtld.c
index 4b54da4b246..158b814db3d 100644
--- a/src/amd/common/ac_rtld.c
+++ b/src/amd/common/ac_rtld.c
@@ -79,17 +79,13 @@ struct ac_rtld_part {
    unsigned num_sections;
 };
 
-static void report_erroraf(const char *fmt, va_list va)
+static void report_errorvf(const char *fmt, va_list va)
 {
-   char *msg;
-   int ret = vasprintf(&msg, fmt, va);
-   if (ret < 0)
-      msg = "(vasprintf failed)";
+   fprintf(stderr, "ac_rtld error: ");
 
-   fprintf(stderr, "ac_rtld error: %s\n", msg);
+   vfprintf(stderr, fmt, va);
 
-   if (ret >= 0)
-      free(msg);
+   fprintf(stderr, "\n");
 }
 
 static void report_errorf(const char *fmt, ...) PRINTFLIKE(1, 2);
@@ -98,7 +94,7 @@ static void report_errorf(const char *fmt, ...)
 {
    va_list va;
    va_start(va, fmt);
-   report_erroraf(fmt, va);
+   report_errorvf(fmt, va);
    va_end(va);
 }
 
@@ -108,7 +104,7 @@ static void report_elf_errorf(const char *fmt, ...)
 {
    va_list va;
    va_start(va, fmt);
-   report_erroraf(fmt, va);
+   report_errorvf(fmt, va);
    va_end(va);
 
    fprintf(stderr, "ELF error: %s\n", elf_errmsg(elf_errno()));



More information about the mesa-commit mailing list