Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ls: exit code 2 when IOError happened for argument #3921

Merged
merged 2 commits into from
Sep 12, 2022

Conversation

niyaznigmatullin
Copy link
Contributor

  • Save if an IOError happened to a file/directory that was specified in the command line as an argument. Make exit code equal to 2 in this case.
  • Add exit code checking for some ls tests

$ info ls:

   Exit status:

     0 success
     1 minor problems  (e.g., failure to access a file or directory not
       specified as a command line argument.  This happens when listing a
       directory in which entries are actively being removed or renamed.)
     2 serious trouble (e.g., memory exhausted, invalid option, failure
       to access a file or directory specified as a command line argument
       or a directory loop)

GNU tests:

  1. tests/ls/dangle
  2. tests/ls/follow-slink
  3. tests/mv/no-target-dir
    are expected to succeed after this change.

@niyaznigmatullin
Copy link
Contributor Author

Ok, quick-xml yanked some of its versions, hope grcov releases new version soon mozilla/grcov#880

@sylvestre
Copy link
Contributor

Let me ping them, I know @calixteman and @marco-c

@sylvestre sylvestre force-pushed the ls_exit_code_2_some_cases branch from ba2e859 to 6016473 Compare September 10, 2022 20:15
@niyaznigmatullin niyaznigmatullin force-pushed the ls_exit_code_2_some_cases branch 2 times, most recently from 88c3d80 to 6418cfd Compare September 12, 2022 12:42
@niyaznigmatullin niyaznigmatullin force-pushed the ls_exit_code_2_some_cases branch from 6418cfd to 8bd9427 Compare September 12, 2022 16:47
@sylvestre
Copy link
Contributor

Indeed!

Congrats! The gnu test tests/ls/dangle is no longer failing!
Congrats! The gnu test tests/ls/follow-slink is no longer failing!
Congrats! The gnu test tests/mv/no-target-dir is no longer failing!

Well spotted

@sylvestre sylvestre merged commit 1ed281f into uutils:main Sep 12, 2022
@niyaznigmatullin niyaznigmatullin deleted the ls_exit_code_2_some_cases branch September 16, 2022 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants