diff --git a/messaging/impl_msgq.cc b/messaging/impl_msgq.cc index d37b8c986d7237..0a51d12c17ff4e 100644 --- a/messaging/impl_msgq.cc +++ b/messaging/impl_msgq.cc @@ -143,7 +143,11 @@ int MSGQPubSocket::connect(Context *context, std::string endpoint){ assert(context); q = new msgq_queue_t; - msgq_new_queue(q, endpoint.c_str(), DEFAULT_SEGMENT_SIZE); + int r = msgq_new_queue(q, endpoint.c_str(), DEFAULT_SEGMENT_SIZE); + if (r != 0){ + return r; + } + msgq_init_publisher(q); return 0; diff --git a/messaging/msgq.cc b/messaging/msgq.cc index 4ccd13df44527a..7c6210ead16c22 100644 --- a/messaging/msgq.cc +++ b/messaging/msgq.cc @@ -90,8 +90,10 @@ int msgq_new_queue(msgq_queue_t * q, const char * path, size_t size){ auto fd = open(full_path, O_RDWR | O_CREAT, 0777); delete[] full_path; - if (fd < 0) + if (fd < 0) { + std::cout << "Warning, could not open: " << full_path << std::endl; return -1; + } int rc = ftruncate(fd, size + sizeof(msgq_header_t)); if (rc < 0)