On Thu, Nov 15, 2018 at 03:23:28PM +0200, [email protected] wrote:
> I have opened an issue for it:
> https://github.com/openvswitch/ovs-issues/issues/165
>
> It's not test specific unfortunately. The file is put up for unlink on exit,
> but I'm guessing
> someone still has an opened handle at that point.
>
> I'm applying this patch for the moment and following up with the actual fix
> for the
> userspace.
Unix has similar-sounding issues with dangling Unix domain sockets. On
Unix, the customary way to solve it is to delete an existing socket
before trying to create one with the same name. You can see that in
make_unix_socket() in socket-util-unix.c:
if (bind_path) {
char linkname[MAX_UN_LEN + 1];
struct sockaddr_un un;
socklen_t un_len;
int dirfd;
if (unlink(bind_path) && errno != ENOENT) {
VLOG_WARN("unlinking \"%s\": %s\n",
bind_path, ovs_strerror(errno));
}
fatal_signal_add_file_to_unlink(bind_path);
If that approach is appropriate under Windows as well, it might be
implemented something like this:
diff --git a/lib/stream-windows.c b/lib/stream-windows.c
index 34bc610b6f49..b027e48b4f8d 100644
--- a/lib/stream-windows.c
+++ b/lib/stream-windows.c
@@ -616,6 +616,11 @@ pwindows_open(const char *name OVS_UNUSED, char *suffix,
path = xstrdup(suffix);
}
+ /* Remove any existing named pipe. */
+ if (remove(bind_path) && errno != ENOENT) {
+ VLOG_WARN("removing \"%s\": %s\n", bind_path, ovs_strerror(errno));
+ }
+
/* Try to create a file under the path location. */
FILE *file = fopen(path, "w");
if (!file) {
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev