Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_con


Modified Files:
        Ecore_Con.h ecore_con.c 


Log Message:
Allow servers to disown their sockets. Allows for closing after a fork()
without unlinking the socket in the filesystem.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_con/Ecore_Con.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- Ecore_Con.h 27 Dec 2005 17:17:30 -0000      1.13
+++ Ecore_Con.h 8 Jan 2006 07:42:56 -0000       1.14
@@ -151,6 +151,7 @@
    EAPI int               ecore_con_server_connected_get(Ecore_Con_Server 
*svr);
    EAPI int               ecore_con_server_send(Ecore_Con_Server *svr, void 
*data, int size);
    EAPI void              ecore_con_server_client_limit_set(Ecore_Con_Server 
*svr, int client_limit, char reject_excess_clients);
+   EAPI void              ecore_con_server_disown(Ecore_Con_Server *svr);
    
    EAPI int               ecore_con_client_send(Ecore_Con_Client *cl, void 
*data, int size);
    EAPI Ecore_Con_Server *ecore_con_client_server_get(Ecore_Con_Client *cl);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_con/ecore_con.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -3 -r1.55 -r1.56
--- ecore_con.c 6 Jan 2006 17:58:12 -0000       1.55
+++ ecore_con.c 8 Jan 2006 07:42:56 -0000       1.56
@@ -606,6 +606,26 @@
 }
 
 /**
+ * Flag the server as not owned by this process, important to use after
+ * forking so child processes do not remove a parents socket path.
+ * Beware that if you set this in the parent, stale sockets may be left
+ * around.
+ * @param   svr           The given server.
+ * @ingroup Ecore_Con_Server_Group
+ */
+void
+ecore_con_server_disown(Ecore_Con_Server *svr)
+{
+   if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER))
+     {
+       ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_CON_SERVER,
+                        "ecore_con_server_client_limit_set");
+       return;
+     }   
+   svr->created = 0;
+}
+
+/**
  * @defgroup Ecore_Con_Client_Group Ecore Connection Client Functions
  *
  * Functions that operate on Ecore connection client objects.




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to