Lines Matching refs:sfd
64 static int sfd; /* shared between do_child and start_server */
141 maybe_run_child(&do_child, "d", &sfd);
257 sfd = socket(PF_INET, SOCK_STREAM, 0);
258 if (sfd < 0) {
262 if (bind(sfd, (struct sockaddr *)sin0, sizeof(*sin0)) < 0) {
266 if (listen(sfd, 10) < 0) {
270 SAFE_GETSOCKNAME(cleanup, sfd, (struct sockaddr *)sin0, &slen);
275 if (self_exec(argv0, "d", sfd) < 0) {
286 (void)close(sfd);
300 FD_SET(sfd, &afds);
302 nfds = sfd + 1;
314 if (FD_ISSET(sfd, &rfds)) {
318 newfd = accept(sfd, (struct sockaddr *)&fsin, &fromlen);
327 if (fd != sfd && FD_ISSET(fd, &rfds)) {