From ca82978e8074c2afb54fb1ae420e2135b7bc420e Mon Sep 17 00:00:00 2001 From: Alan Fitton Date: Sat, 23 Apr 2011 21:09:56 +0000 Subject: handle undefined epoch (< 1) renderer --- src/main.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 0065db7..7807389 100644 --- a/src/main.c +++ b/src/main.c @@ -78,7 +78,7 @@ message_received_cb(UniqueApp * app G_GNUC_UNUSED, int main(int argc, char *argv[]) { - int returnValue; + int returnValue = EXIT_SUCCESS; UniqueApp *app = NULL; TrgMainWindow *window; trg_client *client; @@ -104,6 +104,9 @@ int main(int argc, char *argv[]) UniqueMessageData *message; if (argc > 1) { + /* Turn the arguments into a null terminated array for libunique + * exclude the first (executable name). + */ gchar **files = g_new0(gchar *, argc); int i; for (i = 1; i < argc; i++) @@ -121,11 +124,8 @@ int main(int argc, char *argv[]) response = unique_app_send_message(app, command, message); unique_message_data_free(message); - if (response == UNIQUE_RESPONSE_OK) { - returnValue = 0; - } else { - returnValue = 1; - } + if (response != UNIQUE_RESPONSE_OK) + returnValue = EXIT_FAILURE; } else { client = trg_init_client(); @@ -150,7 +150,5 @@ int main(int argc, char *argv[]) if (withUnique) g_object_unref(app); - gdk_threads_leave(); - - return EXIT_SUCCESS; + return returnValue; } -- cgit v1.2.3