diff options
author | Michael Vogt <mvo@debian.org> | 2014-01-18 08:51:53 +0100 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2014-01-18 08:51:53 +0100 |
commit | 47d7761243a02368bb60b7227bd05a19ca4660d1 (patch) | |
tree | c298a2054c22aae934e25dd22a023efe76649b89 /apt-private/private-sources.cc | |
parent | ea62d40da6b402ff8d4d346971b98e24f096e521 (diff) | |
parent | 8a59cc322ac57c6662949e957611ed718a5f5119 (diff) |
Merge remote-tracking branch 'mvo/debian/sid' into debian/experimental-no-abi-break
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( |