Permit explicit specification of socket path by using an absolute path in the service...
authorxcomputerman <xcomputerman>
Sun, 28 Mar 2004 04:25:52 +0000 (04:25 +0000)
committerxcomputerman <xcomputerman@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 28 Mar 2004 04:25:52 +0000 (04:25 +0000)
SVN revision: 9508

legacy/ecore/src/lib/ecore_con/ecore_con.c

index d212661..604c500 100644 (file)
@@ -132,7 +132,10 @@ ecore_con_server_add(Ecore_Con_Type type,
        else if (type == ECORE_CON_LOCAL_SYSTEM)
          {
             mask = 0;
-            snprintf(buf, sizeof(buf), "/tmp/.ecore_service|%s|%i", name, port);
+        if (name[0] == '/')
+          snprintf(buf, sizeof(buf), "%s|%i", name, port);
+        else
+          snprintf(buf, sizeof(buf), "/tmp/.ecore_service|%s|%i", name, port);
          }
        pmode = umask(mask);
        start:
@@ -286,7 +289,12 @@ ecore_con_server_connect(Ecore_Con_Type type,
             snprintf(buf, sizeof(buf), "%s/.ecore/%s/%i", homedir, name, port);
          }
        else if (type == ECORE_CON_LOCAL_SYSTEM)
-         snprintf(buf, sizeof(buf), "/tmp/.ecore_service|%s|%i", name, port);
+     {
+        if (name[0] == '/')
+          snprintf(buf, sizeof(buf), "%s|%i", name, port);
+        else
+              snprintf(buf, sizeof(buf), "/tmp/.ecore_service|%s|%i", name, port);
+     }
        svr->fd = socket(AF_UNIX, SOCK_STREAM, 0);
        if (svr->fd < 0) goto error;
        if (fcntl(svr->fd, F_SETFL, O_NONBLOCK) < 0) goto error;