diff options
author | Michael Vogt <mvo@debian.org> | 2014-01-25 21:54:52 +0100 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2014-01-25 21:54:52 +0100 |
commit | 62dcafb391a940534d5fb3b804dc461b1187d706 (patch) | |
tree | 83d28ffd4b0af97a0bba4f59c9a44e18091186b6 /apt-private/private-sources.cc | |
parent | e093518c03b49a2def83d8b680be4490fed6e69c (diff) | |
parent | 8c39c4b6e65036390b8ca4d74174192739a4139d (diff) |
Merge branch 'debian/experimental-no-abi-break' into debian/sid
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( |