diff options
author | Michael Vogt <mvo@debian.org> | 2014-01-21 07:20:07 +0100 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2014-01-21 07:20:07 +0100 |
commit | f744c64c591cec9e5aa489a9af55e1ed6d1871d1 (patch) | |
tree | de1d27910d66062508b22c5a7b46c288d1b3fab9 /apt-private/private-sources.cc | |
parent | 7f316a3feab95370f1dd28c08c58bc3c140bf0a0 (diff) | |
parent | 1700c3cfb902f3f61fa4d9269523467fcceaaf58 (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.cc | 5 |
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( |