[sysprof] perf: ignore not-supported failures



commit f4aabd8b7cb2ac249ed0dcbd0062b29914b5bbe7
Author: Christian Hergert <christian hergert me>
Date:   Sat Apr 16 17:16:29 2016 -0700

    perf: ignore not-supported failures
    
    If the pre-authorize fails due to lacking support for sysprofd, that is
    fine, we can fail later on if authorization was required.

 lib/sp-perf-source.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/lib/sp-perf-source.c b/lib/sp-perf-source.c
index 5c4a67e..1561715 100644
--- a/lib/sp-perf-source.c
+++ b/lib/sp-perf-source.c
@@ -460,8 +460,11 @@ sp_perf_source_authorize_cb (GObject      *object,
 
   if (!sp_perf_counter_authorize_finish (result, &error))
     {
-      sp_source_emit_failed (SP_SOURCE (self), error);
-      return;
+      if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED))
+        {
+          sp_source_emit_failed (SP_SOURCE (self), error);
+          return;
+        }
     }
 
   self->is_ready = TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]