Zebediah Figura (@zfigura) commented about server/fd.c:
fd->unix_fd = open( name, O_RDONLY | (flags & ~(O_TRUNC | O_CREAT | O_EXCL)), *mode ); }
/* open(3) throws ENXIO when `path` is one of:* 1. a FIFO, and open(3) is called with O_WRONLY | O_NONBLOCK,* and no other process is currently attempting to read from `path`.* 2. a special device file, and the device it corresponds to does not exist.* 3. a UNIX socket.* We can confirm the third case to allow for unlinking a socket.*/if (errno == ENXIO && !stat( name, &st ) && S_ISSOCK(st.st_mode)){if ((access & DELETE))unlink( name );
This should be checked; I don't think we can depend on errno being cleared.