diff --git a/include/tlibc/errors.h b/include/tlibc/errors.h index 335ccab..c736bb7 100755 --- a/include/tlibc/errors.h +++ b/include/tlibc/errors.h @@ -85,3 +85,10 @@ typedef struct Result_ { Error_printAndExit(_rname(N).error);\ };\ } while(0) + +#define try_stderrcode(CALL) do {\ + int r = CALL;\ + if(r != 0){\ + Return RESULT_ERROR(strerror(r), false);\ + }\ +} while(0)