g_dbus_proxy_new_for_bus_sync should return appropriate values
NULL
should be returned when the Dbus
interface does not exist
C test code
#include <gtk/gtk.h>
int main(int argc, char *argv[])
{
gtk_init (&argc, &argv);
g_autoptr(GDBusProxy) proxy = NULL;
g_autoptr (GError) error = NULL;
proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS |
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
NULL,
"a.b.c",
"/a/b/c",
"a.b.c",
NULL,
&error);
if (proxy == NULL)
{
g_print ("g_dbus_proxy_new_for_bus_sync is error:%s \n", error->message);
}
gtk_main ();
return 0;
}
No matter whether the Dbus
interface name exists or not, it will not return NULL