* net.cc (cygwin_inet_ntoa): Rearrange previous patch to use

thread local buffer space when compiled thread safe.
        (cygwin_getprotobyname): Ditto.
        (cygwin_getprotobynumber): Ditto.
        (cygwin_getservbyname): Ditto.
        (cygwin_getservbyport): Ditto.
        (cygwin_gethostbyname): Ditto.
        (cygwin_gethostbyaddr): Ditto. Move near to cygwin_gethostbyname.
        * thread.h (struct _winsup_t): Add pointers for above used buffer space.
        * passwd.cc (getpwduid): Remove initializing passwd.
        (setpwent): Ditto.
        (endpwent): Ditto.
        (setpassent): Ditto.
This commit is contained in:
Corinna Vinschen
2001-08-22 21:51:48 +00:00
parent 0a047e8f32
commit cb19ccf4b5
4 changed files with 94 additions and 68 deletions

View File

@@ -376,36 +376,24 @@ getpwent (void)
extern "C" struct passwd *
getpwduid (uid_t)
{
if (passwd_state <= initializing)
read_etc_passwd ();
return NULL;
}
extern "C" void
setpwent (void)
{
if (passwd_state <= initializing)
read_etc_passwd ();
pw_pos = 0;
}
extern "C" void
endpwent (void)
{
if (passwd_state <= initializing)
read_etc_passwd ();
pw_pos = 0;
}
extern "C" int
setpassent ()
{
if (passwd_state <= initializing)
read_etc_passwd ();
return 0;
}