[Lldb-commits] [lldb] 3dbf27e - [lldb] A different fix for Domain Socket tests

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 27 09:00:37 PDT 2021


Author: Pavel Labath
Date: 2021-09-27T18:00:27+02:00
New Revision: 3dbf27e762008757c0de7034c778d941bfeb0388

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

LOG: [lldb] A different fix for Domain Socket tests

we need to drop nuls from the end of the string.

Added: 
    

Modified: 
    lldb/source/Host/posix/DomainSocket.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Host/posix/DomainSocket.cpp b/lldb/source/Host/posix/DomainSocket.cpp
index 8138b6ff1dc4..0a43d00e93ee 100644
--- a/lldb/source/Host/posix/DomainSocket.cpp
+++ b/lldb/source/Host/posix/DomainSocket.cpp
@@ -143,7 +143,7 @@ std::string DomainSocket::GetSocketName() const {
   llvm::StringRef name(saddr_un.sun_path + GetNameOffset(),
                        sock_addr_len - offsetof(struct sockaddr_un, sun_path) -
                            GetNameOffset());
-  name = name.drop_while([](char c) { return c == '\0'; });
+  name = name.rtrim('\0');
 
   return name.str();
 }


        


More information about the lldb-commits mailing list