1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

cat: use error code 62 for ELOOP on FreeBSD

This commit is contained in:
Daniel Hofstetter 2023-10-30 07:14:26 +01:00
parent 9697f56e94
commit f39ab620a6

View file

@ -409,9 +409,9 @@ fn get_input_type(path: &str) -> CatResult<InputType> {
if let Some(raw_error) = e.raw_os_error() { if let Some(raw_error) = e.raw_os_error() {
// On Unix-like systems, the error code for "Too many levels of symbolic links" is 40 (ELOOP). // On Unix-like systems, the error code for "Too many levels of symbolic links" is 40 (ELOOP).
// we want to provide a proper error message in this case. // we want to provide a proper error message in this case.
#[cfg(not(target_os = "macos"))] #[cfg(not(any(target_os = "macos", target_os = "freebsd")))]
let too_many_symlink_code = 40; let too_many_symlink_code = 40;
#[cfg(target_os = "macos")] #[cfg(any(target_os = "macos", target_os = "freebsd"))]
let too_many_symlink_code = 62; let too_many_symlink_code = 62;
if raw_error == too_many_symlink_code { if raw_error == too_many_symlink_code {
return Err(CatError::TooManySymlinks); return Err(CatError::TooManySymlinks);