diff options
author | David Robillard <d@drobilla.net> | 2022-09-01 23:35:15 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-09-02 00:05:26 -0400 |
commit | bb3a59f1eff2ad2ac203d063cb714189955bbc93 (patch) | |
tree | 468b9ee9c5e723aa69c56ecdc856e64f738c72f4 /src/status.c | |
parent | 6dc5d6cd358569f1e9654e0ecd5c385fe508b23d (diff) | |
download | zix-bb3a59f1eff2ad2ac203d063cb714189955bbc93.tar.gz zix-bb3a59f1eff2ad2ac203d063cb714189955bbc93.tar.bz2 zix-bb3a59f1eff2ad2ac203d063cb714189955bbc93.zip |
Factor out POSIX-style return pattern
Diffstat (limited to 'src/status.c')
-rw-r--r-- | src/status.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/status.c b/src/status.c index 380d370..e6fbec8 100644 --- a/src/status.c +++ b/src/status.c @@ -38,6 +38,12 @@ zix_strerror(const ZixStatus status) } ZixStatus +zix_errno_status_if(const int r) +{ + return r ? zix_errno_status(errno) : ZIX_STATUS_SUCCESS; +} + +ZixStatus zix_errno_status(const int e) { switch (e) { |