I'm using message queues for inter-thread communication in a server. The server was functioning as expected on Thursday evening. When I picked the project back up on Monday, it was unable to create two of the six queues in use, citing that they were already open (O_
EXCL is set). This should not have been the case, but nevertheless I added an mq_
unlink call with error checking and removed the O_
EXCL flag from mq_
open.
When I compiled and ran, the errno was set to EEXIST by both mq_
unlink and mq_
open. This should be a can't happen: mq_
unlink can't set errno to EEXIST under any circumstances, and mq_
open can only set EEXIST when the O_
EXCL flag is set.
Any ideas why this is happening?