CloseMultipleNowOrOnExec(): promote out of test.

This function will be useful in upcoming non-test code. Because the
first Crashpad client that wants a Crashpad handler will now be
responsible for starting the handler process, this will prevent file
descriptors from leaking to the handler process.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/819483002
This commit is contained in:
Mark Mentovai 2014-12-19 16:42:34 -05:00
parent 5f5e342584
commit 110eafe9a1
4 changed files with 7 additions and 7 deletions

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#include "util/test/posix/close_multiple.h" #include "util/posix/close_multiple.h"
#include <dirent.h> #include <dirent.h>
#include <errno.h> #include <errno.h>

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#ifndef CRASHPAD_UTIL_TEST_POSIX_CLOSE_MULTIPLE_H_ #ifndef CRASHPAD_UTIL_POSIX_CLOSE_MULTIPLE_H_
#define CRASHPAD_UTIL_TEST_POSIX_CLOSE_MULTIPLE_H_ #define CRASHPAD_UTIL_POSIX_CLOSE_MULTIPLE_H_
namespace crashpad { namespace crashpad {
@ -41,4 +41,4 @@ void CloseMultipleNowOrOnExec(int fd, int preserve_fd);
} // namespace crashpad } // namespace crashpad
#endif // CRASHPAD_UTIL_TEST_POSIX_CLOSE_MULTIPLE_H_ #endif // CRASHPAD_UTIL_POSIX_CLOSE_MULTIPLE_H_

View File

@ -21,8 +21,8 @@
#include "base/posix/eintr_wrapper.h" #include "base/posix/eintr_wrapper.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "util/misc/scoped_forbid_return.h" #include "util/misc/scoped_forbid_return.h"
#include "util/posix/close_multiple.h"
#include "util/test/errors.h" #include "util/test/errors.h"
#include "util/test/posix/close_multiple.h"
namespace crashpad { namespace crashpad {
namespace test { namespace test {

View File

@ -99,6 +99,8 @@
'numeric/in_range_cast.h', 'numeric/in_range_cast.h',
'numeric/int128.h', 'numeric/int128.h',
'numeric/safe_assignment.h', 'numeric/safe_assignment.h',
'posix/close_multiple.cc',
'posix/close_multiple.h',
'posix/close_stdio.cc', 'posix/close_stdio.cc',
'posix/close_stdio.h', 'posix/close_stdio.h',
'posix/drop_privileges.cc', 'posix/drop_privileges.cc',
@ -210,8 +212,6 @@
'test/multiprocess.h', 'test/multiprocess.h',
'test/multiprocess_exec.cc', 'test/multiprocess_exec.cc',
'test/multiprocess_exec.h', 'test/multiprocess_exec.h',
'test/posix/close_multiple.cc',
'test/posix/close_multiple.h',
], ],
'conditions': [ 'conditions': [
['OS=="mac"', { ['OS=="mac"', {