41 const char* errmsg = strerror(errno);
42 ADD_FAILURE() <<
"Failed to open unix stream socket: " << errmsg;
46 struct sockaddr_un srv_addr;
47 if (socket_path.size() >
sizeof(srv_addr.sun_path) - 1) {
48 ADD_FAILURE() <<
"Socket path specified (" << socket_path
49 <<
") is larger than " << (
sizeof(srv_addr.sun_path) - 1)
56 memset(&srv_addr, 0,
sizeof(srv_addr));
57 srv_addr.sun_family = AF_UNIX;
58 strncpy(srv_addr.sun_path, socket_path.c_str(),
59 sizeof(srv_addr.sun_path) - 1);
60 socklen_t len =
sizeof(srv_addr);
63 int status = connect(
socket_fd_, (
struct sockaddr*)&srv_addr, len);
65 const char* errmsg = strerror(errno);
66 ADD_FAILURE() <<
"Failed to connect unix socket: fd=" <<
socket_fd_
67 <<
", path=" << socket_path <<
" : " << errmsg;