summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/proc_net_unix.cc
diff options
context:
space:
mode:
authorNicolas Lacasse <nlacasse@google.com>2019-06-28 15:28:24 -0700
committergVisor bot <gvisor-bot@google.com>2019-06-28 15:32:29 -0700
commitcf51e77d6d7cf5302f03812bb726a86e9be572f5 (patch)
treeb4624e72b2d62af64371cd2e66d7596a2327c00f /test/syscalls/linux/proc_net_unix.cc
parent295078fa7ae7893f3deb0e6042e2aecfaba0dd1c (diff)
Fix suggestions from clang.
PiperOrigin-RevId: 255679603
Diffstat (limited to 'test/syscalls/linux/proc_net_unix.cc')
-rw-r--r--test/syscalls/linux/proc_net_unix.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/syscalls/linux/proc_net_unix.cc b/test/syscalls/linux/proc_net_unix.cc
index 74acbe92c..9b9be66ff 100644
--- a/test/syscalls/linux/proc_net_unix.cc
+++ b/test/syscalls/linux/proc_net_unix.cc
@@ -67,7 +67,7 @@ std::string ExtractPath(const struct sockaddr* addr) {
// Abstract socket paths are null padded to the end of the struct
// sockaddr. However, these null bytes may or may not show up in
// /proc/net/unix depending on the kernel version. Truncate after the first
- // null byte (by treating path as a c-std::string).
+ // null byte (by treating path as a c-string).
return StrCat("@", &path[1]);
}
return std::string(path);
@@ -80,7 +80,7 @@ PosixErrorOr<std::vector<UnixEntry>> ProcNetUnixEntries() {
bool skipped_header = false;
std::vector<UnixEntry> entries;
- std::vector<std::string> lines = absl::StrSplit(content, absl::ByAnyChar("\n"));
+ std::vector<std::string> lines = absl::StrSplit(content, '\n');
std::cerr << "<contents of /proc/net/unix>" << std::endl;
for (std::string line : lines) {
// Emit the proc entry to the test output to provide context for the test
@@ -123,7 +123,8 @@ PosixErrorOr<std::vector<UnixEntry>> ProcNetUnixEntries() {
UnixEntry entry;
// Process the first 6 fields, up to but not including "Inode".
- std::vector<std::string> fields = absl::StrSplit(line, absl::MaxSplits(' ', 6));
+ std::vector<std::string> fields =
+ absl::StrSplit(line, absl::MaxSplits(' ', 6));
if (fields.size() < 7) {
return PosixError(EINVAL, StrFormat("Invalid entry: '%s'\n", line));