free(xconn);
}
+static const int one = 1;
+
static int
setnbio(int sock)
{
- static const int one = 1;
return ioctlsocket(sock, FIONBIO, (const void *)&one);
}
+
+static int
+setkeepalive(int sock)
+{
+ return setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, &one, sizeof(one));
+}
\f
static int
setnolinger(int s)
close(s);
return;
}
- setnbio(s), setnolinger(s);
+ setnbio(s), setnolinger(s), setkeepalive(s);
sockdata.prog = prog;
sockdata.retval = 0;
err = krb5int_cm_call_select(&sstate, &sout, &sret);
if (err) {
- com_err(prog, err, "while selecting for network input(1)");
+ if (err != EINTR)
+ com_err(prog, err, "while selecting for network input(1)");
continue;
}
if (sret == 0 && netchanged) {
service_conn(conns[i], prog, sflags);
}
}
+ krb5_klog_syslog(LOG_INFO, "shutdown signal received");
return 0;
}