git-svn-id: http://ltt.polymtl.ca/svn@142 04897980-b3bd-0310-b5e0-8ef037075253
authoryangxx <yangxx@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 25 Jul 2003 15:31:49 +0000 (15:31 +0000)
committeryangxx <yangxx@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 25 Jul 2003 15:31:49 +0000 (15:31 +0000)
ltt/branches/poly/ltt/tracefile.c

index 928f541af152f0bbf859ea91dfd0f7d6936a20fc..d4a4706729086d77ef70bd87effdbaf18a00f14e 100644 (file)
@@ -728,15 +728,17 @@ void ltt_tracefile_seek_time(LttTracefile *t, LttTime time)
        return ltt_tracefile_seek_time(t, time);
       }
     }else if(err < 0){
-      err = t->which_block;
-      ev = ltt_tracefile_read(t);
-      if(ev == NULL){
-       g_print("End of file\n");      
-       return;
+      while(1){
+       ev = ltt_tracefile_read(t);
+       if(ev == NULL){
+         g_print("End of file\n");      
+         return;
+       }
+       g_free(ev);
+       lttTime = getEventTime(t);
+       err = timecmp(&lttTime, &time);
+       if(err >= 0)return;
       }
-      g_free(ev);
-      if(t->which_block == err)
-       return ltt_tracefile_seek_time(t,time);
     }else return;    
   }else if(headTime > 0){
     if(t->which_block == 1){
@@ -762,7 +764,7 @@ void ltt_tracefile_seek_time(LttTracefile *t, LttTime time)
   }else if(headTime == 0){
     updateTracefile(t);
   }else if(tailTime == 0){
-    t->cur_event_pos = t->a_block_end;
+    t->cur_event_pos = t->a_block_end - EVENT_HEADER_SIZE;
     t->current_event_time = time;  
     t->cur_heart_beat_number = 0;
     t->prev_event_time.tv_sec = 0;
This page took 0.024743 seconds and 4 git commands to generate.