mailing list of musl libc
 help / color / mirror / code / Atom feed
7760d4a10a23b54952e02e3b22a748f88e522b99 blob 597 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
#include <pthread.h>
#include "pwf.h"

int getgr_a(const char *name, gid_t gid, struct group *gr, char **buf, size_t *size, char ***mem, size_t *nmem, struct group **res)
{
	FILE *f;
	int rv = 0;
	int cs;

	pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs);

	f = fopen("/etc/group", "rbe");
	if (!f) {
		rv = errno;
		goto done;
	}

	while (!(rv = __getgrent_a(f, gr, buf, size, mem, nmem, res)) && *res) {
		if (name && !strcmp(name, (*res)->gr_name)
		|| !name && (*res)->gr_gid == gid) {
			break;
		}
	}
	fclose(f);

done:
	pthread_setcancelstate(cs, 0);
	if (rv) errno = rv;
	return rv;
}
debug log:

solving 7760d4a ...
found 7760d4a in https://inbox.vuxu.org/musl/1423614776-25579-2-git-send-email-josiahw@gmail.com/

applying [1/1] https://inbox.vuxu.org/musl/1423614776-25579-2-git-send-email-josiahw@gmail.com/
diff --git a/src/passwd/getgr_a.c b/src/passwd/getgr_a.c
new file mode 100644
index 0000000..7760d4a

Checking patch src/passwd/getgr_a.c...
Applied patch src/passwd/getgr_a.c cleanly.

index at:
100644 7760d4a10a23b54952e02e3b22a748f88e522b99	src/passwd/getgr_a.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).