summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Zangerl <az@snafu.priv.at>2014-01-29 11:31:35 +0000
committerAlexander Zangerl <az@snafu.priv.at>2014-01-29 11:31:35 +0000
commit979c650339125580e9d616f46d7879a0f72b2486 (patch)
tree8af977f49738d6ede10758de8588d3ec238fb8ab
parent649dbc2c4dfe97b8ade7bb828d118418b90bec6a (diff)
downloadkuvert-979c650339125580e9d616f46d7879a0f72b2486.tar.gz
kuvert-979c650339125580e9d616f46d7879a0f72b2486.tar.bz2
kuvert-979c650339125580e9d616f46d7879a0f72b2486.zip
fixed logfile handling, perl 5.18 is unhappy with close(...expr that is undef...)
-rwxr-xr-xkuvert6
1 files changed, 4 insertions, 2 deletions
diff --git a/kuvert b/kuvert
index 5392416..f7e889a 100755
--- a/kuvert
+++ b/kuvert
@@ -19,7 +19,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
-# $Id: kuvert,v 2.28 2013/11/25 11:48:37 az Exp az $
+# $Id: kuvert,v 2.29 2013/11/25 11:50:08 az Exp az $
#--
use strict;
@@ -911,7 +911,7 @@ with the new config file in place.\n");
if (-e $value && !-w $value);
if ($config{$key} ne $value) # deal with changing logfiles
{
- close($config{logfh});
+ close($config{logfh}) if (defined $config{logfh});
delete $config{logfh};
}
$options{$key}=$value;
@@ -1323,6 +1323,8 @@ sub logit
if (!$config{logfh}) # not open yet?
{
$config{logfh}=FileHandle->new(">>$config{logfile}");
+ die "can't open logfile $config{logfile}: $!\n"
+ if (!$config{logfh});
$config{logfh}->autoflush(1);
}