Re: [PATCH v8 0/6] MR2786: Add support for AF_UNIX sockets
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. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2786#note_33117
participants (1)
-
Zebediah Figura (@zfigura)