summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-08-25 10:38:28 +0000
committerNorbert Preining <preining@logic.at>2009-08-25 10:38:28 +0000
commitf8bb7bf00ab4d0657f321d42185e32109d44cd5d (patch)
treeea97b0eab05c78867c9a396d589eacf825c04261
parent16e3c94d7360d4ad8d5106fadc3fabfbc797bf02 (diff)
fix TLPDB open fh
git-svn-id: svn://tug.org/texlive/trunk@14855 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/tlpkg/TeXLive/TLPDB.pm16
1 files changed, 5 insertions, 11 deletions
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm
index 34f924fb2c0..b0235fd29c8 100644
--- a/Master/tlpkg/TeXLive/TLPDB.pm
+++ b/Master/tlpkg/TeXLive/TLPDB.pm
@@ -295,6 +295,7 @@ sub from_file {
# remove the un-xz-ed tlpdb file from temp dir
# THAT IS RACY!!! we should fix that in some better way with tempfile
unlink($tlpdbfile) if $tlpdbfile;
+ close($retfh);
return($found);
}
@@ -333,19 +334,12 @@ sub save {
my $path = $self->location;
mkdirhier(dirname($path));
my $tmppath = "$path.tmp";
- #
- # on Windows we cannot move the stuff, at least I don't know how
- if (win32()) {
- open(FOO, ">$path") || die "$0: open(>$path) failed: $!";
- } else {
- open(FOO, ">$tmppath") || die "$0: open(>$tmppath) failed: $!";
- }
+ open(FOO, ">$tmppath") || die "$0: open(>$tmppath) failed: $!";
$self->writeout(\*FOO);
close(FOO);
- if (unix()) {
- # if we managed that one, we move it over
- rename($tmppath, $path);
- }
+ # if we managed that one, we move it over
+ die ("rename $tmppath to $path failed: $!")
+ unless rename($tmppath, $path);
}
=pod