Stop leaking file descriptors.
commita8d530e3ad52cca33a81185ccc9518eab23ddb11
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 15 Mar 2011 00:47:44 +0000 (15 00:47 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 15 Mar 2011 00:47:44 +0000 (15 00:47 +0000)
tree37138bd19cd8a05679fce2584127dd0d8e8ef3aa
parent112d5ee15a09f15e597037724e006004b3f2f78f
Stop leaking file descriptors.

After the open+fstat optimization, files were already opened for FileManager::getBufferForFile() and we closed them after reading them.
The problem was that when -working-directory was passed, the code path that actually reuses & closes the already opened file descriptor
was not followed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127639 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Basic/FileManager.cpp