Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Commit

Permalink
msgq: make sure read_fifos is initalized so we dont close random fds
Browse files Browse the repository at this point in the history
  • Loading branch information
pd0wm committed Nov 16, 2019
1 parent 4e513a8 commit c4f2ad5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 4 additions & 0 deletions messaging/msgq.cc
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ void msgq_init_subscriber(msgq_queue_t * q) {
}
}

for (size_t i = 0; i < NUM_READERS; i++){
q->read_fifos[i] = -1;
}

q->read_fifo_path = "/dev/shm/fifo-";
q->read_fifo_path += std::to_string(q->read_uid_local);

Expand Down
7 changes: 1 addition & 6 deletions messaging/stress.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import time
from messaging_pyx import Context, Poller, SubSocket, PubSocket # pylint: disable=no-name-in-module, import-error

#21845
#32767 after closing mmap fd
from messaging_pyx import Context, SubSocket, PubSocket # pylint: disable=no-name-in-module, import-error

if __name__ == "__main__":
c = Context()
Expand All @@ -14,6 +10,5 @@
sub_sock = SubSocket()
sub_sock.connect(c, "controlsState")


pub_sock.send(b'a')
print(sub_sock.receive())

0 comments on commit c4f2ad5

Please sign in to comment.