8000 sync: move call to unsafe fn to unsafe block by cakebaker · Pull Request #7942 · uutils/coreutils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

sync: move call to unsafe fn to unsafe block #7942

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

Merged

Conversation

cakebaker
Copy link
Contributor

I noticed the following warning in the Android jobs of the CI (see, for example, https://github.com/uutils/coreutils/actions/runs/15039807606/job/42268624578#step:16:836):

[2025-05-15 08:08:33] warning[E0133]: call to unsafe function `libc::syscall` is unsafe and requires unsafe block
[2025-05-15 08:08:33]   --> src/uu/sync/src/sync.rs:45:9
[2025-05-15 08:08:33]    |
[2025-05-15 08:08:33] 45 |         libc::syscall(libc::SYS_sync);
[2025-05-15 08:08:33]    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function

This PR fixes this warning by moving the function call inside the already existing unsafe block used for the non-Android code.

@sylvestre sylvestre force-pushed the sync_move_function_call_to_unsafe_block branch from c69ce44 to cdca6d6 Compare May 19, 2025 09:18
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@sylvestre sylvestre merged commit a7b005c into uutils:main May 20, 2025
70 checks passed
@cakebaker cakebaker deleted the sync_move_function_call_to_unsafe_block branch May 20, 2025 07:45
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
0