fix eof getting per unit
[rugen] / src / page_status.c
index 1047ec6..295217d 100644 (file)
@@ -211,20 +211,22 @@ static void *status_thread( void *arg )
        
        while ( !this->terminated )
        {
+               char buf[32];
+
+               if ( !this->app->eof[this->app->selected_unit] &&
+                       mvcp_unit_get( this->app->command, this->app->selected_unit,
+                       "eof", buf, sizeof(buf) ) != -1)
+                       this->app->eof[this->app->selected_unit] = buf[0];
+
                if ( mvcp_notifier_wait( notifier, &status ) != -1 )
                {
-                       char buf[32];
-
                        if ( status.status == unit_disconnected )
                        {
-                               this->app->eof = 0;
+                               this->app->eof[this->app->selected_unit] = 0;
                                break;
                        }
                        if ( show_status( this, &status ) )
                                show_units( this, TRUE );
-                       if ( !this->app->eof && mvcp_unit_get( this->app->command, this->app->selected_unit,
-                               "eof", buf, sizeof(buf) ) != -1)
-                                       this->app->eof = buf[0];
                }
        }