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

Function wait_status_code

daemonize.c:123–149  ·  view source on GitHub ↗

blockingly waits on the pipe * until a child sends a status code */

Source from the content-addressed store, hash-verified

121/* blockingly waits on the pipe
122 * until a child sends a status code */
123static int wait_status_code(char *code)
124{
125 int rc;
126
127 if (status_pipe[0] == -1) {
128 LM_DBG("invalid read pipe\n");
129 goto error;
130 }
131
132retry:
133 rc = read(status_pipe[0], code, 1);
134 if (rc < 0) {
135 if (errno == EINTR)
136 goto retry;
137
138 LM_ERR("read(1) failed (%d): %d, %s\n", rc, errno, strerror(errno));
139 } else {
140 LM_DBG("read code %d (%d byte)\n", *code, rc);
141 }
142
143 if (rc == 1)
144 return 0;
145
146error:
147 *code = -1;
148 return -1;
149}
150
151int wait_for_one_child(void)
152{

Callers 2

wait_for_one_childFunction · 0.85
wait_for_all_childrenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected