MCPcopy Create free account
hub / github.com/ceph/ceph / init

Method init

src/common/OutputDataSocket.cc:331–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331bool OutputDataSocket::init(const std::string &path)
332{
333 ldout(m_cct, 5) << "init " << path << dendl;
334
335 /* Set up things for the new thread */
336 std::string err;
337 int pipe_rd = -1, pipe_wr = -1;
338 err = create_shutdown_pipe(&pipe_rd, &pipe_wr);
339 if (!err.empty()) {
340 lderr(m_cct) << "OutputDataSocketConfigObs::init: error: " << err << dendl;
341 return false;
342 }
343 int sock_fd;
344 err = bind_and_listen(path, &sock_fd);
345 if (!err.empty()) {
346 lderr(m_cct) << "OutputDataSocketConfigObs::init: failed: " << err << dendl;
347 close(pipe_rd);
348 close(pipe_wr);
349 return false;
350 }
351
352 /* Create new thread */
353 m_sock_fd = sock_fd;
354 m_shutdown_rd_fd = pipe_rd;
355 m_shutdown_wr_fd = pipe_wr;
356 m_path = path;
357 create("out_data_socket");
358 add_cleanup_file(m_path.c_str());
359 return true;
360}
361
362void OutputDataSocket::shutdown()
363{

Callers

nothing calls this directly

Calls 4

createFunction · 0.70
add_cleanup_fileFunction · 0.70
emptyMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected