[Lldb-commits] [lldb] [lldb][POSIX] Replaced bzero with memset (PR #121747)

Dhruv Srivastava via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 6 02:33:01 PST 2025


https://github.com/DhruvSrivastavaX created https://github.com/llvm/llvm-project/pull/121747

Replaced `bzero` with the standard `memset` so that it is common to all platforms. 

Review Request: @DavidSpickett 

>From ced564a1ae7938cddd360684e08077af210654cb Mon Sep 17 00:00:00 2001
From: Dhruv-Srivastava <dhruv.srivastava at ibm.com>
Date: Mon, 6 Jan 2025 04:28:33 -0600
Subject: [PATCH] Replaced bzero with memset

---
 lldb/source/Host/posix/DomainSocket.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/source/Host/posix/DomainSocket.cpp b/lldb/source/Host/posix/DomainSocket.cpp
index f85e1b9bbdc5c0..be8fcdf2c8f2c8 100644
--- a/lldb/source/Host/posix/DomainSocket.cpp
+++ b/lldb/source/Host/posix/DomainSocket.cpp
@@ -182,7 +182,7 @@ std::vector<std::string> DomainSocket::GetListeningConnectionURI() const {
     return {};
 
   struct sockaddr_un addr;
-  bzero(&addr, sizeof(struct sockaddr_un));
+  memset(&addr, 0, sizeof(struct sockaddr_un));
   addr.sun_family = AF_UNIX;
   socklen_t addr_len = sizeof(struct sockaddr_un);
   if (::getsockname(m_socket, (struct sockaddr *)&addr, &addr_len) != 0)



More information about the lldb-commits mailing list