Allow the `error' argument to be NULL; propagate the error to the

2000-11-22  Martin Baulig  <martin@home-of-linux.org>

	* include/glibtop/backends.h (glibtop_open_backend_l): Allow
	the `error' argument to be NULL; propagate the error to the
	glibtop_client in this case.
This commit is contained in:
Martin Baulig
2000-11-22 21:15:28 +00:00
committed by Martin Baulig
parent 9ab1889a3f
commit f704c4becf
4 changed files with 62 additions and 22 deletions

View File

@@ -32,7 +32,6 @@ main (int argc, char *argv [])
glibtop_client *client;
glibtop_backend *backend_common;
glibtop_backend *backend_sysdeps;
GError *error = NULL;
g_type_init ();
@@ -41,26 +40,14 @@ main (int argc, char *argv [])
client = glibtop_client_new ();
backend_common = glibtop_open_backend_l (client, "glibtop-backend-common",
0, NULL, &error);
0, NULL, NULL);
g_message (G_STRLOC ": backend = %p (%p)", backend_common, error);
if (error != NULL) {
glibtop_client_propagate_error (client, error);
g_error_free (error);
error = NULL;
}
g_message (G_STRLOC ": backend = %p", backend_common);
backend_sysdeps = glibtop_open_backend_l (client, "glibtop-backend-sysdeps",
0, NULL, &error);
0, NULL, NULL);
g_message (G_STRLOC ": backend = %p (%p)", backend_sysdeps, error);
if (error != NULL) {
glibtop_client_propagate_error (client, error);
g_error_free (error);
error = NULL;
}
g_message (G_STRLOC ": backend = %p", backend_sysdeps);
exit (0);
}