Lines Matching refs:sfd
63 static int sfd; /* shared between start_server and do_child */
144 maybe_run_child(&do_child, "d", &sfd);
249 sfd = socket(PF_INET, SOCK_STREAM, 0);
250 if (sfd < 0) {
254 if (bind(sfd, (struct sockaddr *)sin0, sizeof(*sin0)) < 0) {
258 if (listen(sfd, 10) < 0) {
262 SAFE_GETSOCKNAME(cleanup, sfd, (struct sockaddr *)sin0, &slen);
267 self_exec(argv0, "d", sfd);
276 (void)close(sfd);
291 FD_SET(sfd, &afds);
293 nfds = sfd + 1;
305 if (FD_ISSET(sfd, &rfds)) {
309 newfd = accept(sfd, (struct sockaddr *)&fsin, &fromlen);
316 if (fd != sfd && FD_ISSET(fd, &rfds)) {