Skip to content

Commit cc3b456

Browse files
msgq: prefix paths with msgq_ (#666)
1 parent 345878d commit cc3b456

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

msgq/event.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
void event_state_shm_mmap(std::string endpoint, std::string identifier, char **shm_mem, std::string *shm_path) {
2323
const char* op_prefix = std::getenv("OPENPILOT_PREFIX");
2424

25-
std::string full_path = "/dev/shm/";
25+
std::string full_path = "/dev/shm/msgq_";
2626
if (op_prefix) {
2727
full_path += std::string(op_prefix) + "/";
2828
}

msgq/msgq.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ int msgq_new_queue(msgq_queue_t * q, const char * path, size_t size){
8787
assert(size < 0xFFFFFFFF); // Buffer must be smaller than 2^32 bytes
8888
std::signal(SIGUSR2, sigusr2_handler);
8989

90-
std::string full_path = "/dev/shm/";
90+
std::string full_path = "/dev/shm/msgq_";
9191
const char* prefix = std::getenv("OPENPILOT_PREFIX");
9292
if (prefix) {
9393
full_path += std::string(prefix) + "/";

msgq/msgq_tests.cc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ TEST_CASE("msgq_msg_init_data")
4343

4444
TEST_CASE("msgq_init_subscriber")
4545
{
46-
remove("/dev/shm/test_queue");
46+
remove("/dev/shm/msgq_test_queue");
4747
msgq_queue_t q;
4848
msgq_new_queue(&q, "test_queue", 1024);
4949
REQUIRE(*q.num_readers == 0);
@@ -63,7 +63,7 @@ TEST_CASE("msgq_init_subscriber")
6363

6464
TEST_CASE("msgq_msg_send first message")
6565
{
66-
remove("/dev/shm/test_queue");
66+
remove("/dev/shm/msgq_test_queue");
6767
msgq_queue_t q;
6868
msgq_new_queue(&q, "test_queue", 1024);
6969
msgq_init_publisher(&q);
@@ -100,7 +100,7 @@ TEST_CASE("msgq_msg_send first message")
100100

101101
TEST_CASE("msgq_msg_send test wraparound")
102102
{
103-
remove("/dev/shm/test_queue");
103+
remove("/dev/shm/msgq_test_queue");
104104
msgq_queue_t q;
105105
msgq_new_queue(&q, "test_queue", 1024);
106106
msgq_init_publisher(&q);
@@ -132,7 +132,7 @@ TEST_CASE("msgq_msg_send test wraparound")
132132

133133
TEST_CASE("msgq_msg_recv test wraparound")
134134
{
135-
remove("/dev/shm/test_queue");
135+
remove("/dev/shm/msgq_test_queue");
136136
msgq_queue_t q_pub, q_sub;
137137
msgq_new_queue(&q_pub, "test_queue", 1024);
138138
msgq_new_queue(&q_sub, "test_queue", 1024);
@@ -178,7 +178,7 @@ TEST_CASE("msgq_msg_recv test wraparound")
178178

179179
TEST_CASE("msgq_msg_send test invalidation")
180180
{
181-
remove("/dev/shm/test_queue");
181+
remove("/dev/shm/msgq_test_queue");
182182
msgq_queue_t q_pub, q_sub;
183183
msgq_new_queue(&q_pub, "test_queue", 1024);
184184
msgq_new_queue(&q_sub, "test_queue", 1024);
@@ -214,7 +214,7 @@ TEST_CASE("msgq_msg_send test invalidation")
214214

215215
TEST_CASE("msgq_init_subscriber init 2 subscribers")
216216
{
217-
remove("/dev/shm/test_queue");
217+
remove("/dev/shm/msgq_test_queue");
218218
msgq_queue_t q1, q2;
219219
msgq_new_queue(&q1, "test_queue", 1024);
220220
msgq_new_queue(&q2, "test_queue", 1024);
@@ -237,7 +237,7 @@ TEST_CASE("msgq_init_subscriber init 2 subscribers")
237237

238238
TEST_CASE("Write 1 msg, read 1 msg", "[integration]")
239239
{
240-
remove("/dev/shm/test_queue");
240+
remove("/dev/shm/msgq_test_queue");
241241
const size_t msg_size = 128;
242242
msgq_queue_t writer, reader;
243243

@@ -273,7 +273,7 @@ TEST_CASE("Write 1 msg, read 1 msg", "[integration]")
273273

274274
TEST_CASE("Write 2 msg, read 2 msg - conflate = false", "[integration]")
275275
{
276-
remove("/dev/shm/test_queue");
276+
remove("/dev/shm/msgq_test_queue");
277277
const size_t msg_size = 128;
278278
msgq_queue_t writer, reader;
279279

@@ -310,7 +310,7 @@ TEST_CASE("Write 2 msg, read 2 msg - conflate = false", "[integration]")
310310

311311
TEST_CASE("Write 2 msg, read 2 msg - conflate = true", "[integration]")
312312
{
313-
remove("/dev/shm/test_queue");
313+
remove("/dev/shm/msgq_test_queue");
314314
const size_t msg_size = 128;
315315
msgq_queue_t writer, reader;
316316

@@ -348,7 +348,7 @@ TEST_CASE("Write 2 msg, read 2 msg - conflate = true", "[integration]")
348348

349349
TEST_CASE("1 publisher, 1 slow subscriber", "[integration]")
350350
{
351-
remove("/dev/shm/test_queue");
351+
remove("/dev/shm/msgq_test_queue");
352352
msgq_queue_t writer, reader;
353353

354354
msgq_new_queue(&writer, "test_queue", 1024);
@@ -391,7 +391,7 @@ TEST_CASE("1 publisher, 1 slow subscriber", "[integration]")
391391

392392
TEST_CASE("1 publisher, 2 subscribers", "[integration]")
393393
{
394-
remove("/dev/shm/test_queue");
394+
remove("/dev/shm/msgq_test_queue");
395395
msgq_queue_t writer, reader1, reader2;
396396

397397
msgq_new_queue(&writer, "test_queue", 1024);

msgq/visionipc/visionbuf_cl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ static void *malloc_with_fd(size_t len, int *fd) {
1717
#ifdef __APPLE__
1818
snprintf(full_path, sizeof(full_path)-1, "/tmp/visionbuf_%d_%d", getpid(), offset++);
1919
#else
20-
snprintf(full_path, sizeof(full_path)-1, "/dev/shm/visionbuf_%d_%d", getpid(), offset++);
20+
snprintf(full_path, sizeof(full_path)-1, "/dev/shm/msgq_visionbuf_%d_%d", getpid(), offset++);
2121
#endif
2222

2323
*fd = open(full_path, O_RDWR | O_CREAT, 0664);

0 commit comments

Comments
 (0)