Date: Sat, 25 Aug 2007 06:06:50 GMT From: dongmei <dongmei@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 125656 for review Message-ID: <200708250606.l7P66oEj006664@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=125656 Change 125656 by dongmei@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),
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708250606.l7P66oEj006664>