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-08 01:32:07 +0400
committerChristopher Faylor <me@cgf.cx>2001-09-08 01:32:07 +0400
commit1ff9f4b9373620aa923412d7aa90b8d04d940199 (patch)
tree878c4a44487d2fe17137a6d6088a327ada14247b /winsup/cygwin/grp.cc
parentb2d319cb3eaf0c1a139ee1586fa43d5250d5a058 (diff)
* cygheap.h (init_cygheap): Move heap pointers here.
* include/sys/cygwin.h (perprocess): Remove heap pointers. * dcrt0.cc (__cygwin_user_data): Reflect obsolete perprocess stuff. (_dll_crt0): Don't initialize heap pointers. (cygwin_dll_init): Ditto. (release_upto): Use heap pointers from cygheap. * heap.h: Ditto. * fork.cc (fork_parent): Ditto. Don't set heap pointers in ch. (fork_child): Remove obsolete sigproc_fixup_after_fork. * shared.cc (memory_init): Reorganize so that cygheap initialization is called prior to regular heap since regular heap uses cygheap now. * sigproc.cc (proc_subproc): Eliminate zombies allocation. (sigproc_init): Move zombies alloation here. Don't free up array on fork, just reuse it. (sigproc_fixup_after_fork): Eliminate. * sigproc.h: Ditto. * include/cygwin/version.h: Reflect change to perprocess structure.
Diffstat (limited to 'winsup/cygwin/grp.cc')
-rw-r--r--winsup/cygwin/grp.cc70
1 files changed, 35 insertions, 35 deletions
diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc
index e73c9a058..b70db13f8 100644
--- a/winsup/cygwin/grp.cc
+++ b/winsup/cygwin/grp.cc
@@ -83,7 +83,7 @@ public:
last_modified = data.ftLastWriteTime;
}
FindClose (h);
- }
+ }
return state;
}
void operator = (grp_state nstate)
@@ -118,37 +118,37 @@ parse_grp (struct group &grp, const char *line)
{
*dp++ = '\0';
if (!strlen (grp.gr_passwd))
- grp.gr_passwd = NULL;
+ grp.gr_passwd = NULL;
grp.gr_gid = strtol (dp, NULL, 10);
dp = strchr (dp, ':');
if (dp)
- {
- if (*++dp)
- {
- int i = 0;
- char *cp;
-
- for (cp = dp; (cp = strchr (cp, ',')) != NULL; ++cp)
- ++i;
- char **namearray = (char **) calloc (i + 2, sizeof (char *));
- if (namearray)
- {
- i = 0;
- for (cp = dp; (cp = strchr (dp, ',')) != NULL; dp = cp + 1)
- {
- *cp = '\0';
- namearray[i++] = dp;
- }
- namearray[i++] = dp;
- namearray[i] = NULL;
- }
+ {
+ if (*++dp)
+ {
+ int i = 0;
+ char *cp;
+
+ for (cp = dp; (cp = strchr (cp, ',')) != NULL; ++cp)
+ ++i;
+ char **namearray = (char **) calloc (i + 2, sizeof (char *));
+ if (namearray)
+ {
+ i = 0;
+ for (cp = dp; (cp = strchr (dp, ',')) != NULL; dp = cp + 1)
+ {
+ *cp = '\0';
+ namearray[i++] = dp;
+ }
+ namearray[i++] = dp;
+ namearray[i] = NULL;
+ }
grp.gr_mem = namearray;
- }
- else
- grp.gr_mem = (char **) calloc (1, sizeof (char *));
- return 1;
- }
+ }
+ else
+ grp.gr_mem = (char **) calloc (1, sizeof (char *));
+ return 1;
+ }
}
return 0;
}
@@ -195,7 +195,7 @@ read_etc_group ()
{
group_state = initializing;
if (max_lines) /* When rereading, free allocated memory first. */
- {
+ {
for (int i = 0; i < curr_lines; ++i)
{
free (group_buf[i].gr_name);
@@ -256,9 +256,9 @@ getgrgid (gid_t gid)
for (int i = 0; i < curr_lines; i++)
{
if (group_buf[i].gr_gid == DEFAULT_GID)
- default_grp = group_buf + i;
+ default_grp = group_buf + i;
if (group_buf[i].gr_gid == gid)
- return group_buf + i;
+ return group_buf + i;
}
return default_grp;
@@ -333,8 +333,8 @@ getgroups (int gidsetsize, gid_t *grouplist, gid_t gid, const char *username)
OpenProcessToken (hMainProc, TOKEN_QUERY, &hToken))
{
if (GetTokenInformation (hToken, TokenGroups, NULL, 0, &size)
- || GetLastError () == ERROR_INSUFFICIENT_BUFFER)
- {
+ || GetLastError () == ERROR_INSUFFICIENT_BUFFER)
+ {
char buf[size];
TOKEN_GROUPS *groups = (TOKEN_GROUPS *) buf;
@@ -358,12 +358,12 @@ getgroups (int gidsetsize, gid_t *grouplist, gid_t gid, const char *username)
break;
}
}
- }
+ }
else
- debug_printf ("%d = GetTokenInformation(NULL) %E", size);
+ debug_printf ("%d = GetTokenInformation(NULL) %E", size);
CloseHandle (hToken);
if (cnt)
- return cnt;
+ return cnt;
}
for (int gidx = 0; (gr = internal_getgrent (gidx)); ++gidx)