[libcxx-commits] [libcxx] dc1ae83 - [libc++][test] Fix a logical mistake introduced by #77058 (#77867)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 12 08:48:38 PST 2024


Author: Wu Yingcong
Date: 2024-01-12T17:48:34+01:00
New Revision: dc1ae8378926e9a730fa7b87ecf73aa9493760ca

URL: https://github.com/llvm/llvm-project/commit/dc1ae8378926e9a730fa7b87ecf73aa9493760ca
DIFF: https://github.com/llvm/llvm-project/commit/dc1ae8378926e9a730fa7b87ecf73aa9493760ca.diff

LOG: [libc++][test] Fix a logical mistake introduced by #77058 (#77867)

A logical mistake is made in #77058, we should try to find a new file
path for socket creation when the path's length generated is bigger than
the socket length limit.

Added: 
    

Modified: 
    libcxx/test/support/filesystem_test_helper.h

Removed: 
    


################################################################################
diff  --git a/libcxx/test/support/filesystem_test_helper.h b/libcxx/test/support/filesystem_test_helper.h
index 2ff237a4b6220c..1b3313d0c1cfb0 100644
--- a/libcxx/test/support/filesystem_test_helper.h
+++ b/libcxx/test/support/filesystem_test_helper.h
@@ -330,7 +330,7 @@ struct scoped_test_env
 // Android platform warns about tmpnam, since the problem does not appear
 // on Android, let's not apply it for Android.
 #  if !defined(__ANDROID__)
-    if (file.size() <= sizeof(address.sun_path)) {
+    if (file.size() > sizeof(address.sun_path)) {
       file = std::tmpnam(nullptr);
     }
 #  endif


        


More information about the libcxx-commits mailing list