246e17
commit 635d6fae03257129b4672591b700a495cb6cb6c7
246e17
Author: H.J. Lu <hjl.tools@gmail.com>
246e17
Date:   Sat Feb 1 05:43:34 2020 -0800
246e17
246e17
    x86: Don't make 2 calls to dlerror () in a row
246e17
    
246e17
    We shouldn't make 2 calls to dlerror () in a row since the first call
246e17
    will clear the error.  We should just use the return value from the
246e17
    first call.
246e17
    
246e17
    Tested on Linux/x86-64.
246e17
    
246e17
    Reviewed-by: Florian Weimer <fweimer@redhat.com>
246e17
---
246e17
246e17
diff --git a/sysdeps/x86/tst-cet-legacy-5.c b/sysdeps/x86/tst-cet-legacy-5.c
246e17
index e1ca09d..0a34d37 100644
246e17
--- a/sysdeps/x86/tst-cet-legacy-5.c
246e17
+++ b/sysdeps/x86/tst-cet-legacy-5.c
246e17
@@ -39,7 +39,7 @@ do_test_1 (const char *modname, bool fail)
246e17
 	      == NULL)
246e17
 	    {
246e17
 	      printf ("incorrect dlopen '%s' error: %s\n", modname,
246e17
-		      dlerror ());
246e17
+		      err);
246e17
 	      exit (1);
246e17
 	    }
246e17
 
246e17
diff --git a/sysdeps/x86/tst-cet-legacy-6.c b/sysdeps/x86/tst-cet-legacy-6.c
246e17
index 184a35b..bd45218 100644
246e17
--- a/sysdeps/x86/tst-cet-legacy-6.c
246e17
+++ b/sysdeps/x86/tst-cet-legacy-6.c
246e17
@@ -39,7 +39,7 @@ do_test_1 (const char *modname, bool fail)
246e17
 	      == NULL)
246e17
 	    {
246e17
 	      printf ("incorrect dlopen '%s' error: %s\n", modname,
246e17
-		      dlerror ());
246e17
+		      err);
246e17
 	      exit (1);
246e17
 	    }
246e17
 
246e17