parsec-service: fix build error

Fixes:
| error: unnecessary qualification
|    --> src/front/domain_socket.rs:247:30
|     |
| 247 |             let ucred_size = mem::size_of::<ucred>();
|     |                              ^^^^^^^^^^^^^^^^^^^^^

Signed-off-by: Armin Kuster <akuster808@gmail.com>
This commit is contained in:
Armin Kuster
2024-12-30 22:00:02 -05:00
parent b825133225
commit f771f969b1
2 changed files with 52 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
From 86d4d2ca2f1e873a29f9f4d4bba99fedee19a144 Mon Sep 17 00:00:00 2001
From: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Date: Thu, 29 Aug 2024 17:10:06 +0100
Subject: [PATCH 2/4] Fix unnecessary qualifications error
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
Upstream-Status: Backport
Signed-off-by: Armin Kuster <akuster808@gmail.com>
---
src/front/domain_socket.rs | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/front/domain_socket.rs b/src/front/domain_socket.rs
index 9fb8a0c..a0effa5 100644
--- a/src/front/domain_socket.rs
+++ b/src/front/domain_socket.rs
@@ -239,15 +239,16 @@ pub mod peer_credentials {
pub mod impl_linux {
use super::UCred;
use libc::{c_void, getsockopt, socklen_t, ucred, SOL_SOCKET, SO_PEERCRED};
+ use std::io;
+ use std::mem::size_of;
use std::os::unix::io::AsRawFd;
use std::os::unix::net::UnixStream;
- use std::{io, mem};
pub fn peer_cred(socket: &UnixStream) -> io::Result<UCred> {
- let ucred_size = mem::size_of::<ucred>();
+ let ucred_size = size_of::<ucred>();
// Trivial sanity checks.
- assert!(mem::size_of::<u32>() <= mem::size_of::<usize>());
+ assert!(size_of::<u32>() <= size_of::<usize>());
assert!(ucred_size <= u32::MAX as usize);
let mut ucred_size = ucred_size as socklen_t;
@@ -266,7 +267,7 @@ pub mod peer_credentials {
&mut ucred_size,
);
- if ret == 0 && ucred_size as usize == mem::size_of::<ucred>() {
+ if ret == 0 && ucred_size as usize == size_of::<ucred>() {
Ok(UCred {
uid: ucred.uid,
gid: ucred.gid,
--
2.43.0

View File

@@ -11,6 +11,7 @@ SRC_URI += "crate://crates.io/parsec-service/${PV} \
file://parsec_init \
file://systemd.patch \
file://parsec-tmpfiles.conf \
file://0002-Fix-unnecessary-qualifications-error.patch \
"
SRC_URI[parsec-service-1.4.1.sha256sum] = "06ad906fb13d6844ad676d4203a1096ae4efc87fe1abcea0481c507df56d8c98"
@@ -47,6 +48,7 @@ INITSCRIPT_NAME = "parsec"
# The file should also be included into SRC_URI then
PARSEC_CONFIG ?= "${S}/config.toml"
do_install () {
# Binaries
install -d -m 700 -o parsec -g parsec "${D}${libexecdir}/parsec"