Mercurial > crates > nonstick
comparison src/libpam/handle.rs @ 185:fb8b547b36b7
Banish al(most al)l use of `i32` in favor of `c_int`.
| author | Paul Fisher <paul@pfish.zone> |
|---|---|
| date | Thu, 31 Jul 2025 14:45:38 -0400 |
| parents | 4f46681b3f54 |
| children | e915c54097d6 |
comparison
equal
deleted
inserted
replaced
| 184:42f747774d94 | 185:fb8b547b36b7 |
|---|---|
| 147 } | 147 } |
| 148 // If it's not LinuxPam, we just drop normally. | 148 // If it's not LinuxPam, we just drop normally. |
| 149 } | 149 } |
| 150 | 150 |
| 151 /// Internal "end" function, which binary-ORs the status with `or_with`. | 151 /// Internal "end" function, which binary-ORs the status with `or_with`. |
| 152 fn end_internal(&mut self, or_with: i32) { | 152 fn end_internal(&mut self, or_with: c_int) { |
| 153 let last: i32 = ReturnCode::from(self.last_return.get()).into(); | 153 let last: c_int = ReturnCode::from(self.last_return.get()).into(); |
| 154 let result = last | or_with; | 154 let result = last | or_with; |
| 155 unsafe { libpam_sys::pam_end(self.handle.cast(), result) }; | 155 unsafe { libpam_sys::pam_end(self.handle.cast(), result) }; |
| 156 } | 156 } |
| 157 } | 157 } |
| 158 | 158 |
| 295 #[doc = linklist!(pam_end: adg, _std)] | 295 #[doc = linklist!(pam_end: adg, _std)] |
| 296 /// | 296 /// |
| 297 #[doc = guide!(adg: "adg-interface-by-app-expected.html#adg-pam_end")] | 297 #[doc = guide!(adg: "adg-interface-by-app-expected.html#adg-pam_end")] |
| 298 #[doc = stdlinks!(3 pam_end)] | 298 #[doc = stdlinks!(3 pam_end)] |
| 299 pub fn end_silent(&mut self, result: Result<()>) { | 299 pub fn end_silent(&mut self, result: Result<()>) { |
| 300 let result: i32 = ReturnCode::from(result).into(); | 300 let result: c_int = ReturnCode::from(result).into(); |
| 301 #[cfg(pam_impl = "LinuxPam")] | 301 #[cfg(pam_impl = "LinuxPam")] |
| 302 let result = result | libpam_sys::PAM_DATA_SILENT; | 302 let result = result | libpam_sys::PAM_DATA_SILENT; |
| 303 unsafe { | 303 unsafe { |
| 304 libpam_sys::pam_end(self.inner_mut(), result); | 304 libpam_sys::pam_end(self.inner_mut(), result); |
| 305 } | 305 } |
