Lines Matching refs:sfd
64 static int sfd; /* shared between do_child and start_server */
119 maybe_run_child(&do_child, "d", &sfd);
228 sfd = socket(PF_INET, SOCK_STREAM, 0);
229 if (sfd < 0) {
233 if (bind(sfd, (struct sockaddr *)sin0, sizeof(*sin0)) < 0) {
237 if (listen(sfd, 10) < 0) {
241 SAFE_GETSOCKNAME(cleanup, sfd, (struct sockaddr *)sin0, &slen);
246 if (self_exec(argv0, "d", sfd) < 0)
257 (void)close(sfd);
271 FD_SET(sfd, &afds);
273 nfds = sfd + 1;
285 if (FD_ISSET(sfd, &rfds)) {
289 newfd = accept(sfd, (struct sockaddr *)&fsin, &fromlen);
298 if (fd != sfd && FD_ISSET(fd, &rfds)) {