[fix] resolve cross-platform build warnings

This commit is contained in:
dijunkun committed 2026-11-07 01:55:51 +08:00
1 parent 33bc5bf13b
commit e3ad683809
14 files changed
+58 -39

No files matched your search

@@ -102,7 +102,11 @@ void Launch(const fs::path& executable, const std::vector<std::string>& argument
}
execv(executable.c_str(), argv.data());
const int error = errno;
(void)write(errors[1], &error, sizeof(error));
// This small blocking pipe write is atomic. Retry signal interruptions so
// the parent cannot mistake a failed exec for a successful launch.
ssize_t written;
do { written = write(errors[1], &error, sizeof(error)); }
while (written < 0 && errno == EINTR);
_exit(127);
}
close(errors[1]);