gfio: allow close with ctrl-w if there are no clients
authorJens Axboe <axboe@kernel.dk>
Tue, 13 Mar 2012 07:20:41 +0000 (08:20 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 13 Mar 2012 07:20:41 +0000 (08:20 +0100)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
gfio.c

diff --git a/gfio.c b/gfio.c
index 1251292e3a5666f3908a6ed64d5bfc5e4867635a..ec033440766f0a27ad6ffee6b10fc8ee887b4486 100644 (file)
--- a/gfio.c
+++ b/gfio.c
@@ -2111,7 +2111,12 @@ static void file_close(GtkWidget *w, gpointer data)
                return;
        }
 
-       show_info_dialog(ui, "Error", "The main page view cannot be closed\n");
+       if (!flist_empty(&ui->list)) {
+               show_info_dialog(ui, "Error", "The main page view cannot be closed\n");
+               return;
+       }
+
+               gtk_main_quit();
 }
 
 static void file_open(GtkWidget *w, gpointer data)