From e766015d60c927aae03b8e43d956c6976c16b2ba Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 13 Jan 2024 15:54:46 -0500 Subject: ioq: Use the negative errno convention --- src/bfstd.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/bfstd.h') diff --git a/src/bfstd.h b/src/bfstd.h index 8953b9b..d160c88 100644 --- a/src/bfstd.h +++ b/src/bfstd.h @@ -63,6 +63,16 @@ bool error_is_like(int error, int category); */ bool errno_is_like(int category); +/** + * Apply the "negative errno" convention. + * + * @param ret + * The return value of the attempted operation. + * @return + * ret, if non-negative, otherwise -errno. + */ +int try(int ret); + #include #ifndef O_EXEC -- cgit v1.2.3