Make sure IPC is arch agnostic

This commit is contained in:
topjohnwu
2025-02-02 22:08:41 +08:00
committed by John Wu
parent 0469817781
commit 88628fdf3c
4 changed files with 25 additions and 25 deletions
+2 -2
View File
@@ -151,7 +151,7 @@ bool get_client_cred(int fd, sock_cred *cred) {
bool read_string(int fd, std::string &str) {
str.clear();
auto len = read_any<size_t>(fd);
int len = read_int(fd);
str.resize(len);
return xxread(fd, str.data(), len) == len;
}
@@ -164,7 +164,7 @@ string read_string(int fd) {
void write_string(int fd, string_view str) {
if (fd < 0) return;
write_any(fd, str.size());
write_int(fd, str.size());
xwrite(fd, str.data(), str.size());
}