Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-02-01 21:41:29 +0300
committerChristopher Faylor <me@cgf.cx>2003-02-01 21:41:29 +0300
commit6688a0618e8cbdfb89b3fd3c670dcd913cd22a08 (patch)
treebfa6a15ece248ad932ad1cc8dbca23a07cec47ec /winsup/cygwin/grp.cc
parent05d2a9a4fb0d5fb79f9696dd41dd1010f4eb2b24 (diff)
* grp.cc (getgrent32): Only refresh group entries when at beginning.
(internal_getgrsid): Only refresh if uninitialized. (internal_getgrent): Ditto. * passwd.cc (getpwent): Only refresh passwd entries when at beginning. (pwdgrp::read_passwd): linebuf *cannot* be NO_COPY. (internal_getpwsid): Only refresh if uninitialized. (getpass): No need to refresh passwd data here. * pwdgrp.h (refresh): Eliminate default.
Diffstat (limited to 'winsup/cygwin/grp.cc')
-rw-r--r--winsup/cygwin/grp.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc
index 35bba1fe2..f252e3cb8 100644
--- a/winsup/cygwin/grp.cc
+++ b/winsup/cygwin/grp.cc
@@ -111,7 +111,7 @@ internal_getgrsid (cygsid &sid)
{
char sid_string[128];
- gr.refresh ();
+ gr.refresh (false);
if (sid.string (sid_string))
for (int i = 0; i < gr.curr_lines; i++)
@@ -197,8 +197,8 @@ endgrent ()
extern "C" struct __group32 *
getgrent32 ()
{
- gr.refresh ();
-
+ if (grp_pos == 0)
+ gr.refresh (true);
if (grp_pos < gr.curr_lines)
return group_buf + grp_pos++;
@@ -223,7 +223,7 @@ setgrent ()
struct __group32 *
internal_getgrent (int pos)
{
- gr.refresh ();
+ gr.refresh (false);
if (pos < gr.curr_lines)
return group_buf + pos;