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

signal: use std::os::raw::c_int instead of libc::c_int on public API #3774

Merged
merged 1 commit into from May 9, 2021
Merged

signal: use std::os::raw::c_int instead of libc::c_int on public API #3774

merged 1 commit into from May 9, 2021

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented May 9, 2021

Motivation

libc::c_int and std::os::raw::c_int are currently the same type, and are unlikely to change to other types, but technically libc can change this in the future minor version.
See #3767 for more.

Solution

Use std::os::raw::c_int on public API to prevent leaking a non-stable type alias from libc.

Fixes #3767

@taiki-e taiki-e requested a review from ipetkov May 9, 2021 17:12
@taiki-e taiki-e changed the title signal: use std::os::raw::c_int on public API instead of libc::c_int signal: use std::os::raw::c_int instead of libc::c_int on public API May 9, 2021
@taiki-e taiki-e added A-tokio Area: The main tokio crate M-signal Module: tokio/signal labels May 9, 2021
Copy link
Member

@ipetkov ipetkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!

@taiki-e taiki-e merged commit 7207e3c into tokio-rs:master May 9, 2021
@taiki-e taiki-e deleted the signal-c_int branch May 9, 2021 17:53
@Darksonn Darksonn mentioned this pull request May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-signal Module: tokio/signal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SignalKind::from_raw leaks a non-stable type alias from libc
2 participants