On 12/06/2014 03:17 PM, Eric Huang wrote:
> Is there a way to detect if an ach_channel_t is already open?
No. Unitialized structs have undefined values, so we cannot tell the
difference between garbage and an open channel only by looking at the
ach_channel_t struct.
> Is it safe to call ach_open on an already open channel?
If you mean passing an ach_channel_t struct that is already opened,
then no, but probably this will only leak a file descriptor.
Impossible to check this in ach_open() because unitialized structs
have undefined values.
You can of course open the same channel multiple times using different
ach_channel_t structs.
Cheers,
--
Neil T. Dantam
http://www.Neil.Dantam.name