aboutsummaryrefslogtreecommitdiffstats
path: root/meta-ivi/recipes-extended/node-health-monitor/node-health-monitor/0001-node-health-monitor-set-valid-format-message-for-g_s.patch
blob: 352d58eecd5c7548c1c21076fb3a60881f78444e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
From 7c17996273746d55cd3990ede7d9e736ddbbfab8 Mon Sep 17 00:00:00 2001
From: Thangam Ramasamy <Thangam_Ramasamy@mentor.com>
Date: Wed, 11 May 2016 15:56:48 +0530
Subject: [PATCH] node-health-monitor: set valid format message for
 g_set_error() calls

Set valid format message to the last parameter of g_set_error() function
instead of sending "NULL". This is needed to fix the gdbus warning message
from glib-2.44.1. Moreover as per the comment in g_error_new_valist()
function passing "NULL" to "format" parameter of g_set_error() function
would be treated as errors. Due to this reason, set a valid format message
to all the g_set_error() function calls.

Signed-off-by: Thangam Ramasamy <Thangam_Ramasamy@mentor.com>
---
 tst/stubs/gen/nsm-dbus-consumer-stub.c    |  4 ++--
 tst/stubs/gen/nsm-dbus-lc-consumer-stub.c |  2 +-
 tst/stubs/gen/nsm-dbus-lc-control-stub.c  |  6 +++---
 tst/stubs/gio/gio-stub.c                  | 10 +++++-----
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/tst/stubs/gen/nsm-dbus-consumer-stub.c b/tst/stubs/gen/nsm-dbus-consumer-stub.c
index 03a24a2..bfce582 100644
--- a/tst/stubs/gen/nsm-dbus-consumer-stub.c
+++ b/tst/stubs/gen/nsm-dbus-consumer-stub.c
@@ -60,7 +60,7 @@ nsm_dbus_consumer_proxy_new_sync_stub(GDBusConnection  *connection,
   else
   {
     retval = NULL;
-    g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_DISCONNECTED, NULL);
+    g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_DISCONNECTED, "dbus connection associated with NSM is disconnected");
   }
 
   return retval;
@@ -91,7 +91,7 @@ nsm_dbus_consumer_call_register_shutdown_client_sync_stub(NsmDbusConsumer  *prox
   else
   {
     retval = FALSE;
-    g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_DISCONNECTED, NULL);
+    g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_DISCONNECTED, "dbus connection associated with NSM is disconnected");
   }
 
   return retval;
diff --git a/tst/stubs/gen/nsm-dbus-lc-consumer-stub.c b/tst/stubs/gen/nsm-dbus-lc-consumer-stub.c
index 82b0195..caeb47f 100644
--- a/tst/stubs/gen/nsm-dbus-lc-consumer-stub.c
+++ b/tst/stubs/gen/nsm-dbus-lc-consumer-stub.c
@@ -58,7 +58,7 @@ nsm_dbus_lc_consumer_proxy_new_sync_stub(GDBusConnection  *connection,
   else
   {
     retval = NULL;
-    g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_DISCONNECTED, NULL);
+    g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_DISCONNECTED, "dbus connection associated with NSM is disconnected");
   }
 
   return retval;
diff --git a/tst/stubs/gen/nsm-dbus-lc-control-stub.c b/tst/stubs/gen/nsm-dbus-lc-control-stub.c
index 14e3096..3ea40a3 100644
--- a/tst/stubs/gen/nsm-dbus-lc-control-stub.c
+++ b/tst/stubs/gen/nsm-dbus-lc-control-stub.c
@@ -60,7 +60,7 @@ nsm_dbus_lc_control_proxy_new_sync_stub(GDBusConnection *connection,
   else
   {
     retval = NULL;
-    g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_DISCONNECTED, NULL);
+    g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_DISCONNECTED, "dbus connection associated with NSM is disconnected");
   }
 
   return retval;
@@ -88,7 +88,7 @@ nsm_dbus_lc_control_call_set_app_health_status_sync_stub(NsmDbusLcControl *proxy
   else
   {
     retval = FALSE;
-    g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_DISCONNECTED, NULL);
+    g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_DISCONNECTED, "dbus connection associated with NSM is disconnected");
   }
 
   return retval;
@@ -116,7 +116,7 @@ nsm_dbus_lc_control_call_request_node_restart_sync_stub(NsmDbusLcControl *proxy,
   else
   {
     retval = FALSE;
-    g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_DISCONNECTED, NULL);
+    g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_DISCONNECTED, "dbus connection associated with NSM is disconnected");
   }
 
   return retval;
diff --git a/tst/stubs/gio/gio-stub.c b/tst/stubs/gio/gio-stub.c
index 6cf8fb1..e273ac2 100644
--- a/tst/stubs/gio/gio-stub.c
+++ b/tst/stubs/gio/gio-stub.c
@@ -156,7 +156,7 @@ g_bus_get_sync_stub(GBusType       bus_type,
   else
   {
     retval = NULL;
-    g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_FAILED, NULL);
+    g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "Could not connect to message bus of bus type '%d'", bus_type);
   }
 
   return retval;
@@ -211,7 +211,7 @@ g_dbus_interface_skeleton_export_stub(GDBusInterfaceSkeleton *interface_,
   else
   {
     retval = FALSE;
-    g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_FAILED, NULL);
+    g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "Could not export dbus interface");
   }
 
   return retval;
@@ -239,7 +239,7 @@ g_dbus_connection_new_for_address_sync_stub(const gchar          *address,
   else
   {
     retval = NULL;
-    g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_FAILED, NULL);
+    g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "Could not setup dbus client connection with address '%s'", address);
   }
 
   return retval;
@@ -286,7 +286,7 @@ g_dbus_connection_call_sync_stub(GDBusConnection    *connection,
 
     if((rval == NULL) && (error != NULL))
     {
-      g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_FAILED, NULL);
+      g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "Could not invoke the dbus method '%s'", method_name);
     }
   }
 
@@ -415,7 +415,7 @@ g_spawn_sync_stub(const gchar          *working_directory,
   else
   {
     retval = FALSE;
-    g_set_error(error, G_SPAWN_ERROR, G_SPAWN_ERROR_FAILED, NULL);
+    g_set_error(error, G_SPAWN_ERROR, G_SPAWN_ERROR_FAILED, "Could not execute the child process '%s'", argv[0]);
   }
 
   return retval;
-- 
1.9.1