Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions iceoryx2-bb/posix/src/process_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,10 @@ impl<'a> Drop for TrackerGuard<'a> {
fn drop(&mut self) {
if self.has_ownership.load(Ordering::Relaxed) {
self.state.remove(self.path);
} else {
if let Some(entry) = self.state.get(self.path)
&& !entry.owned_by_process
{
self.state.remove(self.path);
}
} else if let Some(entry) = self.state.get(self.path)
&& !entry.owned_by_process
{
self.state.remove(self.path);
}
}
}
Expand Down
6 changes: 2 additions & 4 deletions iceoryx2-cli/iox2-gateway/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ fn main() -> anyhow::Result<()> {
if let Err(e) = command::execute(command_name, command_args) {
eprintln!("Failed to execute command: {e}");
}
} else {
if let Err(e) = command::list() {
eprintln!("Failed to list commands: {e}");
}
} else if let Err(e) = command::list() {
eprintln!("Failed to list commands: {e}");
}

Ok(())
Expand Down
8 changes: 8 additions & 0 deletions iceoryx2-pal/posix/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ pub(crate) mod internal {
#![allow(unknown_lints)]
#![allow(unnecessary_transmutes)]
#![allow(unsafe_op_in_unsafe_fn)]
// the 'suspicious_runtime_symbol_definitions' warning was introduced with the Rust 1.98 update;
// the bindgen generated code did not change, so it seems the warning was newly introduced in clippy;
// the warning only occurs on the Windows and macOS platforms;
// this suppression will be removed once #1928 and #1929 (port Windows and macOS from bindgen to libc crate) will be implemented
#![cfg_attr(
any(target_os = "macos", target_os = "windows"),
allow(suspicious_runtime_symbol_definitions)
)]
#![allow(clippy::all)]
#[cfg(not(bazel_build))]
include!(concat!(env!("OUT_DIR"), "/posix_generated.rs"));
Expand Down
10 changes: 5 additions & 5 deletions iceoryx2-pal/posix/src/windows/fcntl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ pub unsafe fn fstat(fd: int, buf: *mut stat_t) -> int {
}
};

if let Some(file_path) = handle_to_file_path(permission_handle) {
if let Some(mode) = acquire_mode_from_path(&file_path) {
file_stat.st_mode |= mode;
}
};
if let Some(file_path) = handle_to_file_path(permission_handle)
&& let Some(mode) = acquire_mode_from_path(&file_path)
{
file_stat.st_mode |= mode;
}

buf.write(file_stat);

Expand Down
8 changes: 4 additions & 4 deletions iceoryx2-pal/posix/src/windows/pthread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ impl ThreadStates {

fn get_index_of(&self, id: u32) -> usize {
for i in 0..MAX_NUMBER_OF_THREADS {
if let Some(ref state) = unsafe { *self.states[i].get() } {
if state.id == id {
return i;
}
if let Some(ref state) = unsafe { *self.states[i].get() }
&& state.id == id
{
return i;
}
}

Expand Down
16 changes: 8 additions & 8 deletions iceoryx2-pal/posix/src/windows/win32_handle_translator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,14 @@ impl HandleTranslator {
*self.free_fd_list_start.get() = next_free_fd;
}

if let FdHandleEntry::UdsDatagramSocket(_) = entry {
if self.uds_datagram_counter.fetch_add(1, Ordering::Relaxed) == 0 {
unsafe {
*self.port_to_uds_translator.get() = Some(
PortToUds::new()
.expect("Unable to create port to uds datagram name translator."),
)
};
if let FdHandleEntry::UdsDatagramSocket(_) = entry
&& self.uds_datagram_counter.fetch_add(1, Ordering::Relaxed) == 0
{
unsafe {
*self.port_to_uds_translator.get() = Some(
PortToUds::new()
.expect("Unable to create port to uds datagram name translator."),
);
}
}

Expand Down
8 changes: 4 additions & 4 deletions iceoryx2-pal/posix/src/windows/win32_security_attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,10 @@ fn parse_ace_string_rights(ace_rights: &[u8]) -> u8 {
}

fn ace_rights_to_bits(ace_rights: &[u8]) -> u8 {
if ace_rights.starts_with(b"0x") {
if let Ok(hex_str) = core::str::from_utf8(&ace_rights[2..]) {
return parse_hex_rights(hex_str);
}
if ace_rights.starts_with(b"0x")
&& let Ok(hex_str) = core::str::from_utf8(&ace_rights[2..])
{
return parse_hex_rights(hex_str);
}
parse_ace_string_rights(ace_rights)
}
Expand Down
Loading