summaryrefslogtreecommitdiffstats
path: root/usr.sbin/i4b
diff options
context:
space:
mode:
authorhm <hm@FreeBSD.org>2001-11-19 14:19:21 +0000
committerhm <hm@FreeBSD.org>2001-11-19 14:19:21 +0000
commitce75de225a983794585a30d66bf58dee21c3c739 (patch)
tree3ed39143dc5a15b4783ed9642d4a767bca21f24b /usr.sbin/i4b
parent229073ca49f328f5c1885e34ab20461fa65a6ece (diff)
downloadFreeBSD-src-ce75de225a983794585a30d66bf58dee21c3c739.zip
FreeBSD-src-ce75de225a983794585a30d66bf58dee21c3c739.tar.gz
Close files only if the fp is != NULL.
PR: bin/31913 Submitted by: Harald Hanche-Olsen <hanche@math.ntnu.no> Reviewed by: hm MFC after: 1 week
Diffstat (limited to 'usr.sbin/i4b')
-rw-r--r--usr.sbin/i4b/isdnd/exec.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/usr.sbin/i4b/isdnd/exec.c b/usr.sbin/i4b/isdnd/exec.c
index 180b97ab..6c9ed62 100644
--- a/usr.sbin/i4b/isdnd/exec.c
+++ b/usr.sbin/i4b/isdnd/exec.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
+ * Copyright (c) 1997, 2001 Hellmuth Michaelis. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,9 @@
* exec.h - supplemental program/script execution
* ----------------------------------------------
*
- * $Id: exec.c,v 1.23 2000/10/09 12:53:29 hm Exp $
- *
* $FreeBSD$
*
- * last edit-date: [Wed Sep 27 09:39:22 2000]
+ * last edit-date: [Mon Nov 19 15:21:38 2001]
*
*---------------------------------------------------------------------------*/
@@ -147,11 +145,12 @@ exec_prog(char *prog, char **arglist)
* 3. /var/log/isdnd.log (or similar, when used)
*/
close(isdnfd);
- if(useacctfile)
+
+ if(useacctfile && acctfp)
fclose(acctfp);
- if(uselogfile)
+
+ if(uselogfile && logfp)
fclose(logfp);
-
if(execvp(path,arglist) < 0 )
_exit(127);
OpenPOWER on IntegriCloud