diff options
author | David Zeuthen <davidz@redhat.com> | 2009-03-31 16:32:20 -0400 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2009-03-31 16:32:20 -0400 |
commit | 240d0a23dcc6c31fa470ebb36ddf1505f581687a (patch) | |
tree | f0e099b226a9c10c40c5555b66fa11025bfb1322 | |
parent | ef78607c6c2cafc73a2ac84208feaf8fbf9e31ad (diff) | |
download | gnome-disk-utility-240d0a23dcc6c31fa470ebb36ddf1505f581687a.tar.gz gnome-disk-utility-240d0a23dcc6c31fa470ebb36ddf1505f581687a.tar.xz gnome-disk-utility-240d0a23dcc6c31fa470ebb36ddf1505f581687a.zip |
return non-zero exit code if volume/drive to show does not exist
-rw-r--r-- | src/palimpsest/gdu-main.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/palimpsest/gdu-main.c b/src/palimpsest/gdu-main.c index 28b888c..22ae7f8 100644 --- a/src/palimpsest/gdu-main.c +++ b/src/palimpsest/gdu-main.c @@ -127,12 +127,15 @@ static GOptionEntry entries[] = { int main (int argc, char **argv) { + gint ret; GduShell *shell; UniqueApp *unique_app; UniqueMessageData *msg_data; UniqueResponse response; GError *error; + ret = 1; + error = NULL; if (!gtk_init_with_args (&argc, &argv, "", entries, GETTEXT_PACKAGE, &error)) { g_error ("%s", error->message); @@ -176,14 +179,19 @@ main (int argc, char **argv) gtk_widget_show_all (gdu_shell_get_toplevel (shell)); gdu_shell_update (shell); - if (volume_to_show) - show_volume (shell, volume_to_show); - else if (drive_to_show) - show_drive (shell, drive_to_show); + if (volume_to_show) { + if (!show_volume (shell, volume_to_show)) + goto out; + } else if (drive_to_show) { + if (!show_drive (shell, drive_to_show)) + goto out; + } gtk_main (); + ret = 0; + out: g_object_unref (shell); - return 0; + return ret; } |