PERFORCE change 125656 for review

dongmei dongmei at FreeBSD.org
Fri Aug 24 23:06:51 PDT 2007


http://perforce.freebsd.org/chv.cgi?CH=125656

Change 125656 by dongmei at dongmei2007 on 2007/08/25 06:06:20

	distinguish the file is tail file or pipe when reset tfile

Affected files ...

.. //depot/projects/soc2007/dongmei-auditanalyzer/tfile.c#6 edit

Differences ...

==== //depot/projects/soc2007/dongmei-auditanalyzer/tfile.c#6 (text+ko) ====

@@ -73,8 +73,8 @@
   {
   	if (tf->ts->fh!=NULL)
   	{
-  		printf("close fh\n");
-  	 	file_close(tf->ts->fh);
+	  	if (tf->type==TAIL_FILE)  
+  	 		file_close(tf->ts->fh);
   	}
   	g_free(tf->ts);
   }
@@ -107,7 +107,7 @@
 	tf->user_saved = !is_tempfile;
 
 	tf->count     = 0;
-
+    tf->type=TAIL_FILE;
 	tf->rlist_chunk = g_mem_chunk_new("record_data_chunk",
 	sizeof(record_data),
 	RECORD_DATA_CHUNK_SIZE * sizeof(record_data),
@@ -126,11 +126,12 @@
 	gchar       *err_info;
 	tsess       *ts;
 
+	tf_reset_state(tf);
+
 	ts=tsess_open_online(err,&err_info,FALSE);
 	if (ts==NULL)
 		goto fail;
 		
-	tf_reset_state(tf);
 	/* We're about to start reading the file. */
 	tf->state = FILE_READ_IN_PROGRESS;
 
@@ -148,7 +149,7 @@
 	tf->user_saved = !is_tempfile;
 
 	tf->count     = 0;
-
+    tf->type=LIVE_FILE;
 	tf->rlist_chunk = g_mem_chunk_new("record_data_chunk",
 	sizeof(record_data),
 	RECORD_DATA_CHUNK_SIZE * sizeof(record_data),


More information about the p4-projects mailing list