From 8399da4d8c0369435e60b0b1bd9cef99e34e558e Mon Sep 17 00:00:00 2001 From: Cyril Hrubis Date: Sun, 7 Apr 2013 10:33:16 +0200 Subject: [PATCH] backends: BackendInit: Don't set errno on all failures. This makes possible to propagate the errno from backends. Signed-off-by: Cyril Hrubis --- libs/backends/GP_BackendInit.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs/backends/GP_BackendInit.c b/libs/backends/GP_BackendInit.c index 5ae1615f..1234a1cf 100644 --- a/libs/backends/GP_BackendInit.c +++ b/libs/backends/GP_BackendInit.c @@ -64,6 +64,7 @@ static int sdl_params_to_flags(const char *param, GP_Size *w, GP_Size *h, } backend_sdl_help(help, "SDL: Invalid parameters"); + errno = EINVAL; return 1; } @@ -181,6 +182,7 @@ static int x11_params_to_flags(const char *param, GP_Size *w, GP_Size *h, } backend_x11_help(help, "X11: Invalid parameters"); + errno = EINVAL; return 1; } @@ -284,9 +286,6 @@ static GP_Backend *init_backend(const char *name, char *params, ret = backend_inits[i](params, caption, help); - if (ret == NULL) - errno = EINVAL; - return ret; } -- 2.11.4.GIT