-/* ulogd_PCAP.c, Version $Revision: 1.5 $
+/* ulogd_PCAP.c, Version $Revision: 1.6 $
*
* ulogd output target for writing pcap-style files (like tcpdump)
*
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id: ulogd_PCAP.c,v 1.5 2003/08/23 17:25:59 laforge Exp $
+ * $Id: ulogd_PCAP.c,v 1.6 2003/09/28 15:19:27 laforge Exp $
*
*/
void append_create_outfile(void) {
struct stat st_dummy;
+ int exist = 0;
- if (stat(pcapf_ce.u.string, &st_dummy)) {
+ if (stat(pcapf_ce.u.string, &st_dummy) == 0 && st.st_size > 0) {
+ exist = 1;
+ }
+
+ if (!exist) {
of = fopen(pcapf_ce.u.string, "w");
if (!of) {
ulogd_log(ULOGD_FATAL, "can't open pcap file: %s\n",