Add my copyright to gfio.c
[fio.git] / gfio.c
diff --git a/gfio.c b/gfio.c
index 0d18ef6feb0bad561733ed59e7dd841ee72c76a5..5b598552c4af77affd266bb7af25f1b944a01910 100644 (file)
--- a/gfio.c
+++ b/gfio.c
@@ -2,6 +2,7 @@
  * gfio - gui front end for fio - the flexible io tester
  *
  * Copyright (C) 2012 Stephen M. Cameron <stephenmcameron@gmail.com> 
+ * Copyright (C) 2012 Jens Axboe <axboe@kernel.dk>
  *
  * The license below covers all files distributed with fio unless otherwise
  * noted in the file itself.
@@ -1227,9 +1228,10 @@ static void connect_clicked(GtkWidget *widget, gpointer data)
                if (!ui->nr_job_files)
                        file_open(widget, data);
                gtk_progress_bar_set_text(GTK_PROGRESS_BAR(ui->thread_status_pb), "No jobs running");
-               fio_clients_connect();
-               pthread_create(&ui->t, NULL, job_thread, NULL);
-               gtk_widget_set_sensitive(ui->button[CONNECT_BUTTON], 0);
+               if (!fio_clients_connect()) {
+                       pthread_create(&ui->t, NULL, job_thread, NULL);
+                       gtk_widget_set_sensitive(ui->button[CONNECT_BUTTON], 0);
+               }
        } else {
                fio_clients_terminate();
                gfio_set_connected(ui, 0);