+again:
+ s = socket(AF_INET, SOCK_STREAM, 0, 0);
+ if (s < 0) {
+ perror("telnetd: socket");;
+ sleep(5);
+ goto again;
+ }
+ if (options & SO_DEBUG)
+ if (setsockopt(s, SOL_SOCKET, SO_DEBUG, 0, 0) < 0)
+ perror("telnetd: setsockopt (SO_DEBUG)");
+ if (setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, 0, 0) < 0)
+ perror("telnetd: setsockopt (SO_KEEPALIVE)");
+ while (bind(s, (caddr_t)&sin, sizeof (sin), 0) < 0) {
+ perror("telnetd: bind");
+ sleep(5);
+ }
+ signal(SIGCHLD, reapchild);
+ listen(s, 10);