1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

Merge pull request #5477 from cakebaker/cat_eloop

cat: use error code 62 for ELOOP on FreeBSD
This commit is contained in:
Sylvestre Ledru 2023-10-30 10:02:25 +01:00 committed by GitHub
commit 72193f8adc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -409,9 +409,9 @@ fn get_input_type(path: &str) -> CatResult<InputType> {
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).
// 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;
#[cfg(target_os = "macos")]
#[cfg(any(target_os = "macos", target_os = "freebsd"))]
let too_many_symlink_code = 62;
if raw_error == too_many_symlink_code {
return Err(CatError::TooManySymlinks);