Skip to content

Commit 62009f5

Browse files
d-e-s-odanielocfb
authored andcommitted
Introduce ErrorKind::Interrupted variant
For (better? or) worse the EINTR error is typically treated somewhat specially by clients. As such, it seems reasonable for us to expose it properly as opposed to just capturing it as "other". Introduce the ErrorKind::Interrupted variant to allow for that. Signed-off-by: Daniel Müller <[email protected]>
1 parent 0026eeb commit 62009f5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libbpf-rs/src/error.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ impl ErrorImpl {
124124
io::ErrorKind::InvalidData => ErrorKind::InvalidData,
125125
io::ErrorKind::TimedOut => ErrorKind::TimedOut,
126126
io::ErrorKind::WriteZero => ErrorKind::WriteZero,
127+
io::ErrorKind::Interrupted => ErrorKind::Interrupted,
127128
io::ErrorKind::Unsupported => ErrorKind::Unsupported,
128129
io::ErrorKind::UnexpectedEof => ErrorKind::UnexpectedEof,
129130
io::ErrorKind::OutOfMemory => ErrorKind::OutOfMemory,
@@ -242,6 +243,10 @@ pub enum ErrorKind {
242243
/// An error returned when an operation could not be completed
243244
/// because a call to [`write`] returned [`Ok(0)`].
244245
WriteZero,
246+
/// This operation was interrupted.
247+
///
248+
/// Interrupted operations can typically be retried.
249+
Interrupted,
245250
/// This operation is unsupported on this platform.
246251
Unsupported,
247252
/// An error returned when an operation could not be completed

0 commit comments

Comments
 (0)