If we can't open alias.log, don't try to write to the

resulting NULL FILE *.
PR:	9403
This commit is contained in:
Brian Somers 1999-01-10 02:05:13 +00:00
parent 219cbf59f2
commit a2743da670
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=42454
2 changed files with 8 additions and 4 deletions

View File

@ -437,7 +437,7 @@ ShowAliasStats(void)
{
/* Used for debugging */
if (packetAliasMode & PKT_ALIAS_LOG)
if (monitorFile)
{
fprintf(monitorFile, "icmp=%d, udp=%d, tcp=%d, frag_id=%d frag_ptr=%d",
icmpLinkCount,
@ -1837,8 +1837,10 @@ InitPacketAliasLog(void)
static void
UninitPacketAliasLog(void)
{
if( monitorFile )
if (monitorFile) {
fclose(monitorFile);
monitorFile = NULL;
}
packetAliasMode &= ~PKT_ALIAS_LOG;
}

View File

@ -437,7 +437,7 @@ ShowAliasStats(void)
{
/* Used for debugging */
if (packetAliasMode & PKT_ALIAS_LOG)
if (monitorFile)
{
fprintf(monitorFile, "icmp=%d, udp=%d, tcp=%d, frag_id=%d frag_ptr=%d",
icmpLinkCount,
@ -1837,8 +1837,10 @@ InitPacketAliasLog(void)
static void
UninitPacketAliasLog(void)
{
if( monitorFile )
if (monitorFile) {
fclose(monitorFile);
monitorFile = NULL;
}
packetAliasMode &= ~PKT_ALIAS_LOG;
}