]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
x86: Don't make 2 calls to dlerror () in a row
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 1 Feb 2020 13:43:34 +0000 (05:43 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 1 Feb 2020 13:43:34 +0000 (05:43 -0800)
We shouldn't make 2 calls to dlerror () in a row since the first call
will clear the error.  We should just use the return value from the
first call.

Tested on Linux/x86-64.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
sysdeps/x86/tst-cet-legacy-5.c
sysdeps/x86/tst-cet-legacy-6.c

index b97e03d6343efdbfec8c2266187bb9baf0be543d..6c9bba06f58d09df3974a214f71b75ea74c29781 100644 (file)
@@ -38,7 +38,7 @@ do_test_1 (const char *modname, bool fail)
          if (strstr (err, "shadow stack isn't enabled") == NULL)
            {
              printf ("incorrect dlopen '%s' error: %s\n", modname,
-                     dlerror ());
+                     err);
              exit (1);
            }
 
index 3c4a47f2db089629e9b29608d9df6a9d71051339..877e77747d56b59ecb5f1b0e9df106a1fb069986 100644 (file)
@@ -38,7 +38,7 @@ do_test_1 (const char *modname, bool fail)
          if (strstr (err, "shadow stack isn't enabled") == NULL)
            {
              printf ("incorrect dlopen '%s' error: %s\n", modname,
-                     dlerror ());
+                     err);
              exit (1);
            }