comparison src/constants.rs @ 176:0730f5f2ee2a

Turn `libpam-sys-consts` back into `libpam-sys-impls`. This moves the constants into `libpam-sys` and makes `libpam-sys-impls` responsible solely for detecting the current PAM implementation.
author Paul Fisher <paul@pfish.zone>
date Wed, 30 Jul 2025 17:53:31 -0400
parents e30775c80b49
children 6c75fb621b55
comparison
equal deleted inserted replaced
175:e30775c80b49 176:0730f5f2ee2a
410 #[cfg(feature = "openpam-ext")] 410 #[cfg(feature = "openpam-ext")]
411 const BAD_CONST: ErrorCode = ErrorCode::BadConstant; 411 const BAD_CONST: ErrorCode = ErrorCode::BadConstant;
412 #[cfg(not(feature = "openpam-ext"))] 412 #[cfg(not(feature = "openpam-ext"))]
413 const BAD_CONST: ErrorCode = ErrorCode::SystemError; 413 const BAD_CONST: ErrorCode = ErrorCode::SystemError;
414 414
415
416 pub(crate) fn result_from(ret: i32) -> Result<()> { 415 pub(crate) fn result_from(ret: i32) -> Result<()> {
417 match ret { 416 match ret {
418 0 => Ok(()), 417 0 => Ok(()),
419 value => Err(ReturnCode(value).try_into().unwrap_or(Self::BAD_CONST)), 418 value => Err(ReturnCode(value).try_into().unwrap_or(Self::BAD_CONST)),
420 } 419 }