]> git.ipfire.org Git - thirdparty/systemd.git/commit
flush_ports: flush POSIX message queues properly
authorTodd C. Miller <Todd.Miller@sudo.ws>
Tue, 6 May 2025 22:39:14 +0000 (16:39 -0600)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 7 May 2025 17:37:45 +0000 (02:37 +0900)
commitffb6adb76367d5ab7d43937ccaac5947717b5b78
tree3c90e53603b22b2df9d63a22f674975e5c178ca8
parent676fb42aaec60281651368f083abb3cbaf3c7dc2
flush_ports: flush POSIX message queues properly

On Linux, read() on a message queue descriptor returns the message
queue statistics, not the actual message queue data.  We need to use
mq_receive() to drain the queues instead.

Fixes a problem where a POSIX message queue socket unit with messages
in the queue at shutdown time could result in a hang on reboot/shutdown.
src/basic/socket-util.c
src/basic/socket-util.h
src/core/socket.c