Skip to content

Commit 0f77a5b

Browse files
authored
Merge pull request #8595 from Ecordonnier/eco/systemd_logind_arm
systemd_logind: replace i8 with libc::c_char
2 parents d08a32b + f5b5a3d commit 0f77a5b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/uucore/src/lib/features/systemd_logind.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ mod login {
5151

5252
/// Get all active sessions
5353
pub fn get_sessions() -> Result<Vec<String>, Box<dyn std::error::Error>> {
54-
let mut sessions_ptr: *mut *mut i8 = ptr::null_mut();
54+
let mut sessions_ptr: *mut *mut libc::c_char = ptr::null_mut();
5555

5656
let result = unsafe { ffi::sd_get_sessions(&mut sessions_ptr) };
5757

@@ -120,7 +120,7 @@ mod login {
120120
/// Get TTY for a session
121121
pub fn get_session_tty(session_id: &str) -> Result<Option<String>, Box<dyn std::error::Error>> {
122122
let session_cstring = CString::new(session_id)?;
123-
let mut tty_ptr: *mut i8 = ptr::null_mut();
123+
let mut tty_ptr: *mut libc::c_char = ptr::null_mut();
124124

125125
let result = unsafe { ffi::sd_session_get_tty(session_cstring.as_ptr(), &mut tty_ptr) };
126126

@@ -149,7 +149,7 @@ mod login {
149149
session_id: &str,
150150
) -> Result<Option<String>, Box<dyn std::error::Error>> {
151151
let session_cstring = CString::new(session_id)?;
152-
let mut host_ptr: *mut i8 = ptr::null_mut();
152+
let mut host_ptr: *mut libc::c_char = ptr::null_mut();
153153

154154
let result =
155155
unsafe { ffi::sd_session_get_remote_host(session_cstring.as_ptr(), &mut host_ptr) };
@@ -179,7 +179,7 @@ mod login {
179179
session_id: &str,
180180
) -> Result<Option<String>, Box<dyn std::error::Error>> {
181181
let session_cstring = CString::new(session_id)?;
182-
let mut display_ptr: *mut i8 = ptr::null_mut();
182+
let mut display_ptr: *mut libc::c_char = ptr::null_mut();
183183

184184
let result =
185185
unsafe { ffi::sd_session_get_display(session_cstring.as_ptr(), &mut display_ptr) };
@@ -209,7 +209,7 @@ mod login {
209209
session_id: &str,
210210
) -> Result<Option<String>, Box<dyn std::error::Error>> {
211211
let session_cstring = CString::new(session_id)?;
212-
let mut type_ptr: *mut i8 = ptr::null_mut();
212+
let mut type_ptr: *mut libc::c_char = ptr::null_mut();
213213

214214
let result = unsafe { ffi::sd_session_get_type(session_cstring.as_ptr(), &mut type_ptr) };
215215

@@ -238,7 +238,7 @@ mod login {
238238
session_id: &str,
239239
) -> Result<Option<String>, Box<dyn std::error::Error>> {
240240
let session_cstring = CString::new(session_id)?;
241-
let mut seat_ptr: *mut i8 = ptr::null_mut();
241+
let mut seat_ptr: *mut libc::c_char = ptr::null_mut();
242242

243243
let result = unsafe { ffi::sd_session_get_seat(session_cstring.as_ptr(), &mut seat_ptr) };
244244

0 commit comments

Comments
 (0)