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 ecore_con_private.h Log Message: Revert disown call and force the parent to check if it created the socket before unlinking it. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_con/Ecore_Con.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- Ecore_Con.h 8 Jan 2006 07:42:56 -0000 1.14 +++ Ecore_Con.h 11 Jan 2006 05:13:23 -0000 1.15 @@ -151,7 +151,6 @@ 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.56 retrieving revision 1.57 diff -u -3 -r1.56 -r1.57 --- ecore_con.c 8 Jan 2006 07:42:56 -0000 1.56 +++ ecore_con.c 11 Jan 2006 05:13:23 -0000 1.57 @@ -318,6 +318,7 @@ svr->reject_excess_clients = 0; svr->client_limit = -1; svr->clients = ecore_list_new(); + svr->ppid = getpid(); ecore_list_append(servers, svr); ECORE_MAGIC_SET(svr, ECORE_MAGIC_CON_SERVER); return svr; @@ -606,26 +607,6 @@ } /** - * 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. @@ -777,7 +758,7 @@ while (!ecore_list_is_empty(svr->clients)) _ecore_con_client_free(ecore_list_remove_first(svr->clients)); ecore_list_destroy(svr->clients); - if ((svr->created) && (svr->path)) unlink(svr->path); + if ((svr->created) && (svr->path) && (svr->ppid == getpid())) unlink(svr->path); if (svr->fd >= 0) close(svr->fd); #if USE_OPENSSL if (svr->ssl) =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_con/ecore_con_private.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- ecore_con_private.h 7 Sep 2005 08:30:51 -0000 1.11 +++ ecore_con_private.h 11 Jan 2006 05:13:23 -0000 1.12 @@ -67,6 +67,7 @@ char connecting : 1; char reject_excess_clients : 1; int client_limit; + pid_t ppid; #if USE_OPENSSL SSL_CTX *ssl_ctx; ------------------------------------------------------- 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