diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2012-04-11 17:45:36 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2012-04-11 17:45:36 +0200 |
commit | c3753d1de25737aed66d6ca14d0473042b7c55a7 (patch) | |
tree | 750745b523fee36d66b4cdd041fc8117be22c5fe /apt-pkg/cdrom.cc | |
parent | 621aeca0bc8fe39c57d6221c7581c758e5822fd0 (diff) | |
parent | d68d65ad637526e46ea77ab83e07470d26df15fc (diff) |
merged from donkults experimental branch
Diffstat (limited to 'apt-pkg/cdrom.cc')
-rw-r--r-- | apt-pkg/cdrom.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index 4462d4e24..50c204371 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -430,7 +430,8 @@ bool pkgCdrom::WriteDatabase(Configuration &Cnf) Out.close(); - link(DFile.c_str(),string(DFile + '~').c_str()); + if (FileExists(DFile) == true && link(DFile.c_str(),string(DFile + '~').c_str()) != 0) + return _error->Errno("link", "Failed to link %s to %s~", DFile.c_str(), DFile.c_str()); if (rename(NewFile.c_str(),DFile.c_str()) != 0) return _error->Errno("rename","Failed to rename %s.new to %s", DFile.c_str(),DFile.c_str()); @@ -697,7 +698,8 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/ return false; } - chdir(StartDir.c_str()); + if (chdir(StartDir.c_str()) != 0) + return _error->Errno("chdir","Unable to change to %s", StartDir.c_str()); if (_config->FindB("Debug::aptcdrom",false) == true) { |