summaryrefslogtreecommitdiff
path: root/apt-private/private-sources.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-01-21 07:20:07 +0100
committerMichael Vogt <mvo@debian.org>2014-01-21 07:20:07 +0100
commitf744c64c591cec9e5aa489a9af55e1ed6d1871d1 (patch)
treede1d27910d66062508b22c5a7b46c288d1b3fab9 /apt-private/private-sources.cc
parent7f316a3feab95370f1dd28c08c58bc3c140bf0a0 (diff)
parent1700c3cfb902f3f61fa4d9269523467fcceaaf58 (diff)
Merge remote-tracking branch 'upstream/debian/experimental-no-abi-break' into feature/source-deb822
Conflicts: test/integration/test-apt-sources-deb822
Diffstat (limited to 'apt-private/private-sources.cc')
-rw-r--r--apt-private/private-sources.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/apt-private/private-sources.cc b/apt-private/private-sources.cc
index 65706e785..41cf6b313 100644
--- a/apt-private/private-sources.cc
+++ b/apt-private/private-sources.cc
@@ -32,6 +32,10 @@ bool EditSources(CommandLine &CmdL)
if (FileExists(sourceslist))
before.FromFile(sourceslist);
+ int lockfd = GetLock(sourceslist);
+ if (lockfd < 0)
+ return false;
+
do {
EditFileInSensibleEditor(sourceslist);
_error->PushToStack();
@@ -46,6 +50,7 @@ bool EditSources(CommandLine &CmdL)
}
_error->RevertToStack();
} while (res == false);
+ close(lockfd);
if (FileExists(sourceslist) && !before.VerifyFile(sourceslist)) {
strprintf(