summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian <brian@cvs.openbsd.org>1999-01-10 02:08:38 +0000
committerbrian <brian@cvs.openbsd.org>1999-01-10 02:08:38 +0000
commit40a4ee3d14430dc3d7820866cc688e3fb4f1e05e (patch)
treec2d67bd5c39e587de5c2018e4168fb793407bc4e
parentef20f0f27e244591af53f0fd259f2d82ff1c3ea5 (diff)
If we can't open alias.log, don't try to write to the
resulting NULL FILE *.
-rw-r--r--usr.sbin/ppp/ppp/alias_db.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/ppp/ppp/alias_db.c b/usr.sbin/ppp/ppp/alias_db.c
index 7bbb19122be..dc9d020bd85 100644
--- a/usr.sbin/ppp/ppp/alias_db.c
+++ b/usr.sbin/ppp/ppp/alias_db.c
@@ -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;
}