From f78348a92a7ec801e337c8ff3466eba39e91842e Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Fri, 10 Nov 2017 23:40:49 +0100 Subject: [PATCH] uev_run(): Return unique error codes in case of actual error. Signed-off-by: Joachim Nilsson --- src/uev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/uev.c b/src/uev.c index 0f5115e..df7b8b7 100644 --- a/src/uev.c +++ b/src/uev.c @@ -325,7 +325,7 @@ int uev_run(uev_ctx_t *ctx, int flags) /* Unrecoverable error, cleanup and exit with error. */ uev_exit(ctx); - return -1; + return -2; } for (i = 0; ctx->running && i < nfds; i++) { @@ -343,8 +343,9 @@ int uev_run(uev_ctx_t *ctx, int flags) /* Must recreate epoll fd now ... */ if (_init(ctx, 1)) { + /* Catastrophic error, no way to recover. */ uev_exit(ctx); - return -2; + return -3; } /* Restart watchers in new efd */