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>2001-09-14 07:01:47 +0400
committerChristopher Faylor <me@cgf.cx>2001-09-14 07:01:47 +0400
commitcd6ed3f9f5ab14944f7c591a3dc9ca285b754a33 (patch)
tree27c8d56472d600043f627049563f0e32c8865323
parente2e078278cc951344fc5c0a976715bd1fe11f2d8 (diff)
* grp.cc (read_etc_group): Just reuse group_buf storage for subsequent reread
of /etc/group. * passwd.cc (read_etc_passwd): Just reuse passwd_buf storage for subsequent reread of /etc/passwd.
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/grp.cc3
-rw-r--r--winsup/cygwin/passwd.cc3
3 files changed, 9 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index acb342047..6e6b28987 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+Thu Sep 13 23:01:00 2001 Christopher Faylor <cgf@cygnus.com>
+
+ * grp.cc (read_etc_group): Just reuse group_buf storage for subsequent
+ reread of /etc/group.
+ * passwd.cc (read_etc_passwd): Just reuse passwd_buf storage for
+ subsequent reread of /etc/passwd.
+
Thu Sep 13 20:46:05 2001 Christopher Faylor <cgf@cygnus.com>
* cygheap.cc (dup_now): New function.
diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc
index 62b585965..48a74e99c 100644
--- a/winsup/cygwin/grp.cc
+++ b/winsup/cygwin/grp.cc
@@ -152,8 +152,7 @@ read_etc_group ()
free (group_buf[i].gr_name);
free (group_buf[i].gr_mem);
}
- free (group_buf);
- curr_lines = max_lines = 0;
+ curr_lines = 0;
}
FILE *f = fopen (etc_group, "rt");
diff --git a/winsup/cygwin/passwd.cc b/winsup/cygwin/passwd.cc
index ed37e98ea..87ba9c672 100644
--- a/winsup/cygwin/passwd.cc
+++ b/winsup/cygwin/passwd.cc
@@ -137,8 +137,7 @@ read_etc_passwd ()
{
for (int i = 0; i < curr_lines; ++i)
free (passwd_buf[i].pw_name);
- free (passwd_buf);
- curr_lines = max_lines = 0;
+ curr_lines = 0;
}
FILE *f = fopen ("/etc/passwd", "rt");