From e3732f4ffe1812c71c02ecbdddc06230b3c06fe8 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Thu, 26 Oct 2000 13:09:23 +0000 Subject: [PATCH] DW: - logfileOpen() doesn't use O_TRUNC, so we need to unlink/truncate the netdb_state file explicitly. --- src/net_db.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/net_db.cc b/src/net_db.cc index 9cd8ad9bfe..9fceceb8f6 100644 --- a/src/net_db.cc +++ b/src/net_db.cc @@ -1,6 +1,6 @@ /* - * $Id: net_db.cc,v 1.149 2000/10/10 18:15:30 wessels Exp $ + * $Id: net_db.cc,v 1.150 2000/10/26 07:09:23 wessels Exp $ * * DEBUG: section 38 Network Measurement Database * AUTHOR: Duane Wessels @@ -379,6 +379,11 @@ netdbSaveState(void *foo) * Solaris bugs, its a bad idea. fopen can fail if more than * 256 FDs are open. */ + /* + * unlink() is here because there is currently no way to make + * logfileOpen() use O_TRUNC. + */ + unlink(path); lf = logfileOpen(path, 4096, 0); if (NULL == lf) { debug(50, 1) ("netdbSaveState: %s: %s\n", path, xstrerror()); -- 2.47.2