forked from enlightenment/efl
return initcount on init and shutdown
SVN revision: 16647
This commit is contained in:
parent
49fd515a14
commit
ebaf552ccd
|
@ -109,14 +109,13 @@ ecore_con_dns_init(void)
|
||||||
char *p, *p2;
|
char *p, *p2;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
dns_init++;
|
if (++dns_init > 1) return dns_init;
|
||||||
if (dns_init > 1) return 1;
|
|
||||||
|
|
||||||
memset(servers, 0, sizeof(servers));
|
memset(servers, 0, sizeof(servers));
|
||||||
server_count = 0;
|
server_count = 0;
|
||||||
|
|
||||||
file = fopen("/etc/resolv.conf", "rb");
|
file = fopen("/etc/resolv.conf", "rb");
|
||||||
if (!file) return 0;
|
if (!file) return --dns_init;
|
||||||
while (fgets(buf, sizeof(buf), file))
|
while (fgets(buf, sizeof(buf), file))
|
||||||
{
|
{
|
||||||
if (strlen(buf) >= 1023)
|
if (strlen(buf) >= 1023)
|
||||||
|
@ -218,17 +217,17 @@ ecore_con_dns_init(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
printf("init: %d\n", dns_init);
|
||||||
|
return dns_init;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
int
|
||||||
ecore_con_dns_shutdown(void)
|
ecore_con_dns_shutdown(void)
|
||||||
{
|
{
|
||||||
Ecore_List2 *l;
|
Ecore_List2 *l;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
dns_init--;
|
if (--dns_init > 0) return dns_init;
|
||||||
if (dns_init > 0) return;
|
|
||||||
|
|
||||||
for (l = (Ecore_List2 *)dns_cache; l;)
|
for (l = (Ecore_List2 *)dns_cache; l;)
|
||||||
{
|
{
|
||||||
|
@ -248,6 +247,9 @@ ecore_con_dns_shutdown(void)
|
||||||
for (i = 0; i < search_count; i++)
|
for (i = 0; i < search_count; i++)
|
||||||
free(search[i]);
|
free(search[i]);
|
||||||
search_count = 0;
|
search_count = 0;
|
||||||
|
|
||||||
|
printf("shutdown: %d\n", dns_init);
|
||||||
|
return dns_init;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -88,5 +88,5 @@ struct _Ecore_Con_Url
|
||||||
|
|
||||||
/* from ecore_con_dns.c */
|
/* from ecore_con_dns.c */
|
||||||
int ecore_con_dns_init(void);
|
int ecore_con_dns_init(void);
|
||||||
void ecore_con_dns_shutdown(void);
|
int ecore_con_dns_shutdown(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue