Use symbolic name instead of hardcoded value on telnet(1):
Index: commands.c
===================================================================
RCS file: /cvs/src/usr.bin/telnet/commands.c,v
retrieving revision 1.79
diff -u -p -u -r1.79 commands.c
--- commands.c 13 Nov 2015 17:04:48 -0000 1.79
+++ commands.c 20 Nov 2015 12:30:50 -0000
@@ -1192,7 +1192,7 @@ static void
close_connection(void)
{
if (connected) {
- (void) shutdown(net, 2);
+ (void) shutdown(net, SHUT_RDWR);
printf("Connection closed.\r\n");
(void)close(net);
connected = 0;