about summary refs log tree commit diff
path: root/posix/wordexp-test.c
diff options
context:
space:
mode:
authorFrédéric Bérat <fberat@redhat.com>2023-06-01 16:27:47 +0200
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2023-06-01 13:01:32 -0400
commit29e25f6f136182fb3756d51e03dea7c4d1919dd9 (patch)
tree4d3950068c9fec569ae21055641b986632371fbb /posix/wordexp-test.c
parenta952fcda58cd7aa191140fc9e7d453df212b9117 (diff)
downloadglibc-29e25f6f136182fb3756d51e03dea7c4d1919dd9.tar.gz
glibc-29e25f6f136182fb3756d51e03dea7c4d1919dd9.tar.xz
glibc-29e25f6f136182fb3756d51e03dea7c4d1919dd9.zip
tests: fix warn unused results
With fortification enabled, few function calls return result need to be
checked, has they get the __wur macro enabled.
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Diffstat (limited to 'posix/wordexp-test.c')
-rw-r--r--posix/wordexp-test.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/posix/wordexp-test.c b/posix/wordexp-test.c
index bae27d6cee..524597d96b 100644
--- a/posix/wordexp-test.c
+++ b/posix/wordexp-test.c
@@ -253,7 +253,11 @@ do_test (int argc, char *argv[])
   cwd = getcwd (NULL, 0);
 
   /* Set up arena for pathname expansion */
-  tmpnam (tmpdir);
+  if (!tmpnam (tmpdir))
+    {
+      printf ("Failed to create a temporary directory with a unique name: %m");
+      return 1;
+    }
   xmkdir (tmpdir, S_IRWXU);
   TEST_VERIFY_EXIT (chdir (tmpdir) == 0);