diff options
Diffstat (limited to 'importxml.pl')
-rwxr-xr-x | importxml.pl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/importxml.pl b/importxml.pl index 3d0ea6206..5b0599e98 100755 --- a/importxml.pl +++ b/importxml.pl @@ -60,6 +60,7 @@ chdir $::path; use lib ($::path); use Bugzilla; +use Bugzilla::Config qw(:DEFAULT $datadir); use XML::Parser; use Data::Dumper; @@ -126,7 +127,7 @@ sub MailMessage { sub Log { my ($str) = (@_); Lock(); - open(FID, ">>data/maillog") || die "Can't write to data/maillog"; + open(FID, ">>$datadir/maillog") || die "Can't write to $datadir/maillog"; print FID time2str("%D %H:%M", time()) . ": $str\n"; close FID; Unlock(); @@ -135,13 +136,13 @@ sub Log { sub Lock { if ($::lockcount <= 0) { $::lockcount = 0; - open(LOCKFID, ">>data/maillock") || die "Can't open data/maillock: $!"; + open(LOCKFID, ">>$datadir/maillock") || die "Can't open $datadir/maillock: $!"; my $val = flock(LOCKFID,2); if (!$val) { # '2' is magic 'exclusive lock' const. print Bugzilla->cgi->header(); print "Lock failed: $val\n"; } - chmod 0666, "data/maillock"; + chmod 0666, "$datadir/maillock"; } $::lockcount++; } |