source: asp3_tinet_ecnl_rx/trunk/musl-1.1.18/src/passwd/putgrent.c@ 337

Last change on this file since 337 was 337, checked in by coas-nagasima, 6 years ago

ASP3版ECNLを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-csrc;charset=UTF-8
File size: 413 bytes
Line 
1#define _GNU_SOURCE
2#include <grp.h>
3#include <stdio.h>
4
5int putgrent(const struct group *gr, FILE *f)
6{
7 int r;
8 size_t i;
9 flockfile(f);
10 if ((r = fprintf(f, "%s:%s:%d:", gr->gr_name, gr->gr_passwd, gr->gr_gid))<0) goto done;
11 if (gr->gr_mem) for (i=0; gr->gr_mem[i]; i++)
12 if ((r = fprintf(f, "%s%s", i?",":"", gr->gr_mem[i]))<0) goto done;
13 r = fputc('\n', f);
14done:
15 funlockfile(f);
16 return r<0 ? -1 : 0;
17}
Note: See TracBrowser for help on using the repository browser.