0

Code Health: Use span variant of base::ReadFromFd

The variant which passes a char* + offset is being removed

This CL is split from https://crrev.com/c/5168849

This CL was uploaded by git cl split.

R=rsesek@chromium.org

Bug: 1490484
Change-Id: I0c9edcf0ff699c65fd3011c61655b7b7c10e9674
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5179686
Auto-Submit: Austin Sullivan <asully@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1244692}
This commit is contained in:
Austin Sullivan
2024-01-09 16:02:21 +00:00
committed by Chromium LUCI CQ
parent cd3a7d99eb
commit f04c23eef2

@ -19,6 +19,7 @@
#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/containers/span.h"
#include "base/files/file_util.h"
#include "base/files/platform_file.h"
#include "base/linux_util.h"
@ -459,8 +460,9 @@ int Zygote::ForkWithRealPid(const std::string& process_type,
// Now read back our real PID from the zygote.
base::ProcessId real_pid;
if (!base::ReadFromFD(read_pipe.get(), reinterpret_cast<char*>(&real_pid),
sizeof(real_pid))) {
if (!base::ReadFromFD(
read_pipe.get(),
base::as_writable_chars(base::make_span(&real_pid, 1u)))) {
LOG(FATAL) << "Failed to synchronise with parent zygote process";
}
if (real_pid <= 0) {