MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / group2gid

Function group2gid

ut.c:99–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97
98
99int group2gid(int* gid, char* group)
100{
101 char* tmp;
102 struct group *gr_entry;
103
104 if (group){
105 *gid=strtol(group, &tmp, 10);
106 if ((tmp==0) ||(*tmp)){
107 /* maybe it's a string */
108 gr_entry=getgrnam(group);
109 if (gr_entry==0){
110 goto error;
111 }
112 *gid=gr_entry->gr_gid;
113 }
114 return 0;
115 }
116error:
117 return -1;
118}
119
120/* utility function to give each children a unique seed */
121void seed_child(unsigned int seed)

Callers 3

mainFunction · 0.85
mi_mod_initFunction · 0.85
mi_mod_initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected