Re: [Intel-gfx] [PATCH i-g-t] lib/igt_core: Handle glib errors correctly to avoid stderr spew

2017-07-20 Thread Paul Kocialkowski
On Thu, 2017-07-20 at 10:45 +0300, Paul Kocialkowski wrote:
> This adds the required error clean/free calls after calling
> configuration parsing functions. In addition to properly handling
> memory,
> this avoids glib spewing out error messages on stderr, which breaks
> the
> whole CI.

Fixes: ee31e0b5 ("Introduce common frame dumping configuration...")

> Signed-off-by: Paul Kocialkowski 
> ---
>  lib/igt_core.c | 11 ++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 028ef6bd..03d9a5bf 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -637,10 +637,16 @@ static int config_parse(void)
>   "FrameDumpPat
> h",
>   );
>  
> + g_clear_error();
> +
>   rc = g_key_file_get_integer(igt_key_file, "DUT",
> "SuspendResumeDelay",
>   );
> - if (error && error->code == G_KEY_FILE_ERROR_INVALID_VALUE)
> + if (error && error->code == G_KEY_FILE_ERROR_INVALID_VALUE) {
> + g_error_free(error);
>   return -2;
> + }
> +
> + g_clear_error();
>  
>   if (rc != 0)
>   igt_set_autoresume_delay(rc);
> @@ -809,6 +815,7 @@ static int common_init(int *argc, char **argv,
>   ret = g_key_file_load_from_file(igt_key_file, key_file_loc,
>   G_KEY_FILE_NONE, );
>   if (error && error->code == G_KEY_FILE_ERROR) {
> + g_error_free(error);
>   g_key_file_free(igt_key_file);
>   igt_key_file = NULL;
>   ret = -2;
> @@ -816,6 +823,8 @@ static int common_init(int *argc, char **argv,
>   goto out;
>   }
>  
> + g_clear_error();
> +
>   ret = config_parse();
>  #endif
>  
-- 
Paul Kocialkowski 
Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo, Finland
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH i-g-t] lib/igt_core: Handle glib errors correctly to avoid stderr spew

2017-07-20 Thread Paul Kocialkowski
This adds the required error clean/free calls after calling
configuration parsing functions. In addition to properly handling memory,
this avoids glib spewing out error messages on stderr, which breaks the
whole CI.

Signed-off-by: Paul Kocialkowski 
---
 lib/igt_core.c | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 028ef6bd..03d9a5bf 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -637,10 +637,16 @@ static int config_parse(void)
"FrameDumpPath",
);
 
+   g_clear_error();
+
rc = g_key_file_get_integer(igt_key_file, "DUT", "SuspendResumeDelay",
);
-   if (error && error->code == G_KEY_FILE_ERROR_INVALID_VALUE)
+   if (error && error->code == G_KEY_FILE_ERROR_INVALID_VALUE) {
+   g_error_free(error);
return -2;
+   }
+
+   g_clear_error();
 
if (rc != 0)
igt_set_autoresume_delay(rc);
@@ -809,6 +815,7 @@ static int common_init(int *argc, char **argv,
ret = g_key_file_load_from_file(igt_key_file, key_file_loc,
G_KEY_FILE_NONE, );
if (error && error->code == G_KEY_FILE_ERROR) {
+   g_error_free(error);
g_key_file_free(igt_key_file);
igt_key_file = NULL;
ret = -2;
@@ -816,6 +823,8 @@ static int common_init(int *argc, char **argv,
goto out;
}
 
+   g_clear_error();
+
ret = config_parse();
 #endif
 
-- 
2.13.2

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx