From owner-p4-projects@FreeBSD.ORG Sat Aug 25 06:06:50 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A4DE016A468; Sat, 25 Aug 2007 06:06:50 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 655D916A418 for ; Sat, 25 Aug 2007 06:06:50 +0000 (UTC) (envelope-from dongmei@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 5477913C461 for ; Sat, 25 Aug 2007 06:06:50 +0000 (UTC) (envelope-from dongmei@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l7P66oJL006668 for ; Sat, 25 Aug 2007 06:06:50 GMT (envelope-from dongmei@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l7P66oEj006664 for perforce@freebsd.org; Sat, 25 Aug 2007 06:06:50 GMT (envelope-from dongmei@FreeBSD.org) Date: Sat, 25 Aug 2007 06:06:50 GMT Message-Id: <200708250606.l7P66oEj006664@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to dongmei@FreeBSD.org using -f From: dongmei To: Perforce Change Reviews Cc: Subject: PERFORCE change 125656 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Aug 2007 06:06:51 -0000 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),