diff options
author | Philip Withnall <withnall@endlessm.com> | 2017-02-03 16:36:04 +0000 |
---|---|---|
committer | Philip Withnall <withnall@endlessm.com> | 2017-02-09 09:32:01 +0000 |
commit | c0ce3fb33569f4af08a3bfd32a825893f3f05818 (patch) | |
tree | b8b20cff051b396bea432527e9f7c849fa0a6b59 | |
parent | 399d8d40af5546f0eff6416d3573934a251ce233 (diff) | |
download | libgdata-c0ce3fb33569f4af08a3bfd32a825893f3f05818.tar.gz |
demos: Return a useful exit code from the docs-list demo
-rw-r--r-- | demos/docs-list/docs-list.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/demos/docs-list/docs-list.c b/demos/docs-list/docs-list.c index 44ef28b8..85e0e1e6 100644 --- a/demos/docs-list/docs-list.c +++ b/demos/docs-list/docs-list.c @@ -41,6 +41,7 @@ main (void) GList *entries; GList *l; GoaClient *client = NULL; + gint retval; setlocale (LC_ALL, ""); @@ -48,6 +49,7 @@ main (void) if (error != NULL) { g_warning ("%s", error->message); g_error_free (error); + retval = 1; goto out; } @@ -71,6 +73,7 @@ main (void) if (service == NULL) { g_warning ("Account not found"); + retval = 1; goto out; } @@ -82,11 +85,13 @@ main (void) if (error != NULL) { g_warning ("%s", error->message); g_error_free (error); + retval = 1; goto out; } entries = gdata_feed_get_entries (GDATA_FEED (feed)); if (entries == NULL) { + retval = 0; goto out; } @@ -102,6 +107,8 @@ main (void) g_object_unref (feed); } + retval = 0; + out: g_clear_object (&feed); g_clear_object (&query); @@ -109,5 +116,5 @@ out: g_clear_object (&client); g_list_free_full (accounts, g_object_unref); - return 0; + return retval; } |