Skip to content

Commit

Permalink
Merge pull request #143 from daniestevez/armv7-fix-build
Browse files Browse the repository at this point in the history
logging: fix build in armv7
  • Loading branch information
lucab committed Nov 8, 2023
2 parents c9d1e90 + a76ad73 commit 15868a6
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -320,9 +319,9 @@ fn send_memfd_payload(sock: &UnixDatagram, data: &[u8]) -> Result<usize, SdError
#[derive(Debug, Eq, PartialEq)]
pub struct JournalStream {
/// The device number of the journal stream.
device: u64,
device: libc::dev_t,
/// The inode number of the journal stream.
inode: u64,
inode: libc::ino_t,
}

impl JournalStream {
Expand All @@ -345,13 +344,13 @@ impl JournalStream {
s
)
})?;
let device = u64::from_str(device_s).with_context(|| {
let device = libc::dev_t::from_str(device_s).with_context(|| {
format!(
"Failed to parse journal stream: Device part is not a number '{}'",
device_s
)
})?;
let inode = u64::from_str(inode_s).with_context(|| {
let inode = libc::ino_t::from_str(inode_s).with_context(|| {
format!(
"Failed to parse journal stream: Inode part is not a number '{}'",
inode_s
Expand All @@ -378,16 +377,6 @@ impl JournalStream {
Self::from_env_impl("JOURNAL_STREAM")
}

/// Get the journal stream that would correspond to the given file metadata.
///
/// Return a journal stream struct containing the device and inode number of the given file metadata.
pub fn from_metadata(metadata: &Metadata) -> 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.
Expand Down

0 comments on commit 15868a6

Please sign in to comment.