summaryrefslogtreecommitdiff
path: root/methods/rred.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2005-08-22 08:48:50 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2005-08-22 08:48:50 +0000
commit59a704f0efe9cf243f1b27ac833558b89728aa9c (patch)
tree101ca1b0a24e8725753ee071f1310e39622c448e /methods/rred.cc
parent16176b647e76f316ec98f31f6dd806a49d7b8a77 (diff)
downloadapt-59a704f0efe9cf243f1b27ac833558b89728aa9c.tar.gz
* rred.cc: use the d'tor of FileFd to close the file-fd; acquuire-item.cc: make the QueueNextDiff() code more robust
Diffstat (limited to 'methods/rred.cc')
-rw-r--r--methods/rred.cc11
1 files changed, 2 insertions, 9 deletions
diff --git a/methods/rred.cc b/methods/rred.cc
index e28dc685..3097fca0 100644
--- a/methods/rred.cc
+++ b/methods/rred.cc
@@ -178,7 +178,8 @@ bool RredMethod::Fetch(FetchItem *Itm)
URIStart(Res);
// Res.Filename the destination filename
- // Open the source and destination files
+ // Open the source and destination files (the d'tor of FileFd will do
+ // the cleanup/closing of the fds)
FileFd From(Path,FileFd::ReadOnly);
FileFd Patch(Path+".ed",FileFd::ReadOnly);
FileFd To(Itm->DestFile,FileFd::WriteEmpty);
@@ -193,14 +194,6 @@ bool RredMethod::Fetch(FetchItem *Itm)
// now do the actual patching
ed_file(fPatch, fFrom, fTo, &Hash);
- // clean up
- fclose(fFrom);
- fclose(fPatch);
- fclose(fTo);
- To.Close();
- From.Close();
- Patch.Close();
-
// XXX need to get the size
// Res.Size = Buf.st_size;
Res.TakeHashes(Hash);