0001-Fix-unnecessary-qualifications-error.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. From b76bebf839169fc831712b8a80db1e6ff7535dfd Mon Sep 17 00:00:00 2001
  2. From: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
  3. Date: Thu, 29 Aug 2024 17:10:06 +0100
  4. Subject: [PATCH] Fix unnecessary qualifications error
  5. Upstream: https://github.com/parallaxsecond/parsec/commit/86d4d2ca2f1e873a29f9f4d4bba99fedee19a144
  6. Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
  7. Signed-off-by: Julien Olivain <ju.o@free.fr>
  8. ---
  9. src/front/domain_socket.rs | 9 +++++----
  10. 1 file changed, 5 insertions(+), 4 deletions(-)
  11. diff --git a/src/front/domain_socket.rs b/src/front/domain_socket.rs
  12. index 9fb8a0c..a0effa5 100644
  13. --- a/src/front/domain_socket.rs
  14. +++ b/src/front/domain_socket.rs
  15. @@ -239,15 +239,16 @@ pub mod peer_credentials {
  16. pub mod impl_linux {
  17. use super::UCred;
  18. use libc::{c_void, getsockopt, socklen_t, ucred, SOL_SOCKET, SO_PEERCRED};
  19. + use std::io;
  20. + use std::mem::size_of;
  21. use std::os::unix::io::AsRawFd;
  22. use std::os::unix::net::UnixStream;
  23. - use std::{io, mem};
  24. pub fn peer_cred(socket: &UnixStream) -> io::Result<UCred> {
  25. - let ucred_size = mem::size_of::<ucred>();
  26. + let ucred_size = size_of::<ucred>();
  27. // Trivial sanity checks.
  28. - assert!(mem::size_of::<u32>() <= mem::size_of::<usize>());
  29. + assert!(size_of::<u32>() <= size_of::<usize>());
  30. assert!(ucred_size <= u32::MAX as usize);
  31. let mut ucred_size = ucred_size as socklen_t;
  32. @@ -266,7 +267,7 @@ pub mod peer_credentials {
  33. &mut ucred_size,
  34. );
  35. - if ret == 0 && ucred_size as usize == mem::size_of::<ucred>() {
  36. + if ret == 0 && ucred_size as usize == size_of::<ucred>() {
  37. Ok(UCred {
  38. uid: ucred.uid,
  39. gid: ucred.gid,
  40. --
  41. 2.47.1