Zebediah Figura (@zfigura) commented about server/fd.c:
}
/* 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 );
else
{
set_error( ENXIO );
That's... not really correct, ENXIO isn't an NTSTATUS. Better just to let this hit the same file_set_error() path.