diff --git a/src/process.cc b/src/process.cc index 14aaede..f250603 100644 --- a/src/process.cc +++ b/src/process.cc @@ -267,10 +267,9 @@ OSTD_EXPORT void subprocess::open_impl( fd_stderr.close(true); fd_stderr.fdopen(err, false); } - p_current = ::new (reinterpret_cast(&p_data)) data{}; - data *pd = static_cast(p_current); - pd->pid = int(cpid); - pd->errno_fd = std::exchange(fd_errno[1], -1); + p_current = ::new (reinterpret_cast(&p_data)) data{ + int(cpid), std::exchange(fd_errno[1], -1) + }; } }