]> rtime.felk.cvut.cz Git - frescor/forb.git/commitdiff
Added unlinking of stale UNIX sockets
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 11 Oct 2008 10:22:41 +0000 (12:22 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 11 Oct 2008 10:22:41 +0000 (12:22 +0200)
TODO
src/proto_unix.c

diff --git a/TODO b/TODO
index 3a8d039506834ac3f917f34168025481cfd3b61b..8565bf06afe021c82fd7f75fca75cd4854e92f60 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,9 +1,6 @@
 * Implement forb_register_reference() and forb_resolve_reference() to
   allow applications find CM/DTM.
 
-* Check whether unix_proto broadcast works correctly when there are
-   stale forb sockets in /tmp
-
 * Add forb_init() parameters: argc, argv and orb_id
 
 * More flexible handling of log messages (dynamic registration,
index e6c79815dd2624ec91286e8bef5f595e132e770d..86dfd4b4aa6d47ecb37109fa20e3eef64e9dacbf 100644 (file)
@@ -139,6 +139,9 @@ unix_broadcast(forb_port_t *port, const void *buf, size_t len)
                         * the socket may nomore be active */
                        if (ret == len) {
                                success++;
+                       } else if (ret < 0 && errno == ECONNREFUSED) {
+                               /* Try to unlink stale socket */
+                               unlink(addr.sun_path);
                        } else {
 /*                             perror("unix_broadcast"); */
 /*                             return ret; */