From a76ad7381b595867c79a24685cde3c0ee69e2093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Est=C3=A9vez?= Date: Fri, 28 Apr 2023 09:35:22 +0200 Subject: [PATCH] fix build in armv7 In armv7-unknown-linux-gnueabihf (ARM 32-bit), FileStat::st_ino is an u32 instead of an u64, so we cannot directly assign to JournalStream::inode, which is an u64. Instead of using u64 in the fields of JournalStream, we use libc::dev_t and libc::ino_t. The JournalStream::from_metadata function has been removed since it assumes that the fields are u64 and is no longer used. --- src/logging.rs | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/logging.rs b/src/logging.rs index 802d1c6..3595465 100644 --- a/src/logging.rs +++ b/src/logging.rs @@ -7,9 +7,8 @@ use nix::sys::stat::{fstat, FileStat}; use once_cell::sync::OnceCell; use std::collections::HashMap; use std::ffi::{CStr, CString, OsStr}; -use std::fs::{File, Metadata}; +use std::fs::File; use std::io::prelude::*; -use std::os::linux::fs::MetadataExt; use std::os::unix::io::AsRawFd; use std::os::unix::net::UnixDatagram; use std::os::unix::prelude::AsFd; @@ -320,9 +319,9 @@ fn send_memfd_payload(sock: &UnixDatagram, data: &[u8]) -> Result Self { - Self { - device: metadata.st_dev(), - inode: metadata.st_ino(), - } - } - /// Get the journal stream that would correspond to the given file descriptor. /// /// Return a journal stream struct containing the device and inode number of the given file descriptor.