mirror of
https://gitlab.com/hyask/swaysome.git
synced 2025-12-09 23:34:42 +01:00
fix: use NativeEndian to work also on big endian systems like s390x
This commit is contained in:
parent
9dd0fd6831
commit
59333d6804
1 changed files with 4 additions and 4 deletions
|
|
@ -8,7 +8,7 @@ use std::mem;
|
|||
use std::os::unix::net::UnixStream;
|
||||
use std::path::Path;
|
||||
|
||||
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
|
||||
use byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt};
|
||||
|
||||
// Maximum workspaces per group. This will determine the naming.
|
||||
// Examples:
|
||||
|
|
@ -99,12 +99,12 @@ impl SwaySome {
|
|||
|
||||
msg_prefix[6..]
|
||||
.as_mut()
|
||||
.write_u32::<LittleEndian>(payload_length)
|
||||
.write_u32::<NativeEndian>(payload_length)
|
||||
.expect("Unable to write");
|
||||
|
||||
msg_prefix[10..]
|
||||
.as_mut()
|
||||
.write_u32::<LittleEndian>(msg_type)
|
||||
.write_u32::<NativeEndian>(msg_type)
|
||||
.expect("Unable to write");
|
||||
|
||||
let mut msg: Vec<u8> = msg_prefix[..].to_vec();
|
||||
|
|
@ -142,7 +142,7 @@ impl SwaySome {
|
|||
response_header[8],
|
||||
response_header[9],
|
||||
]);
|
||||
let payload_length = v.read_u32::<LittleEndian>().unwrap();
|
||||
let payload_length = v.read_u32::<NativeEndian>().unwrap();
|
||||
|
||||
let mut payload = vec![0; payload_length as usize];
|
||||
socket.read_exact(&mut payload[..]).unwrap();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue