Skip to content

ls: use libc::{major, minor} to calculate device number#4120

Merged
sylvestre merged 2 commits intouutils:mainfrom
SteveLauC:ls/device-number-use-major-minor-from-libc
Nov 9, 2022
Merged

ls: use libc::{major, minor} to calculate device number#4120
sylvestre merged 2 commits intouutils:mainfrom
SteveLauC:ls/device-number-use-major-minor-from-libc

Conversation

@SteveLauC
Copy link
Contributor

At the time of #2145, major and minor have not been added to libc, so we have to manually calculate the device number.

And those functions have been added (rust-lang/libc#2937) so that we can employ them.

BTW, I called cargo fmt on this file, but I didn't see rustfmt.toml in this project, so if you guys don't like it, feel free to ask to to discard the format changes.

Ref: #2140

@sylvestre
Copy link
Contributor

I love simplifications :)

@SteveLauC SteveLauC force-pushed the ls/device-number-use-major-minor-from-libc branch from 09d30e9 to 2bb75a9 Compare November 9, 2022 09:10
@github-actions
Copy link

github-actions bot commented Nov 9, 2022

GNU testsuite comparison:

GNU test failed: tests/misc/timeout. tests/misc/timeout is passing on 'main'. Maybe you have to rebase?

@SteveLauC
Copy link
Contributor Author

Test Android builds (28, default, x86) failed on a cp test, which seems unrelated to this PR:

failures:

---- test_cp::test_cp_parents_2_dirs stdout ----
current_directory_resolved: 
mkdir_all: /data/data/com.termux/files/usr/tmp/.tmp1DCT2X/a/b/c
mkdir: /data/data/com.termux/files/usr/tmp/.tmp1DCT2X/d
run: /data/data/com.termux/files/home/coreutils/target/debug/coreutils cp -a --parents a/b/c d
thread 'test_cp::test_cp_parents_2_dirs' panicked at 'Command was expected to succeed.
stdout = 
 stderr = cp: Permission denied (os error 13)
', tests/common/util.rs:176:9


failures:
    test_cp::test_cp_parents_2_dirs

test result: FAILED. 2325 passed; 1 failed; 31 ignored; 0 measured; 0 filtered out; finished in 215.43s

error: test failed, to rerun pass `--test tests`
error: 1 target failed:
    `--test tests`
Error: The process '/bin/sh' failed with exit code 101

And sadly I have no idea about the failure in Run GNU tests...

@sylvestre
Copy link
Contributor

both of them aren't your fault ... noise :(

@sylvestre sylvestre merged commit 7d8ec3b into uutils:main Nov 9, 2022
@sylvestre
Copy link
Contributor

thanks!

@SteveLauC SteveLauC deleted the ls/device-number-use-major-minor-from-libc branch November 9, 2022 10:29
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