This diff removes redundant defines in two files.

In s_socket.c, SOCKET_PROTOCOL is defined as IPPROTO_TCP, but it's only
used once.

In s_time.c, NO_SHUTDOWN is always defined, so there is no need for a
bunch of NO_SHUTDOWN #ifdef blocks.

No binary change.

ok?


Index: s_socket.c
===================================================================
RCS file: /cvs/src/usr.bin/openssl/s_socket.c,v
retrieving revision 1.7
diff -u -p -u -p -r1.7 s_socket.c
--- s_socket.c  20 Jul 2015 03:22:25 -0000      1.7
+++ s_socket.c  8 Sep 2015 02:43:13 -0000
@@ -77,8 +77,6 @@ static int init_server(int *sock, int po
 static int init_server_long(int *sock, int port, char *ip, int type);
 static int do_accept(int acc_sock, int *sock, char **host);
 
-#define SOCKET_PROTOCOL        IPPROTO_TCP
-
 int
 init_client(int *sock, char *host, char *port, int type, int af)
 {
@@ -187,7 +185,7 @@ init_server_long(int *sock, int port, ch
                memcpy(&server.sin_addr.s_addr, ip, 4);
 
        if (type == SOCK_STREAM)
-               s = socket(AF_INET, SOCK_STREAM, SOCKET_PROTOCOL);
+               s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
        else                    /* type == SOCK_DGRAM */
                s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
 
Index: s_time.c
===================================================================
RCS file: /cvs/src/usr.bin/openssl/s_time.c,v
retrieving revision 1.9
diff -u -p -u -p -r1.9 s_time.c
--- s_time.c    22 Aug 2015 16:36:05 -0000      1.9
+++ s_time.c    8 Sep 2015 02:44:30 -0000
@@ -56,8 +56,6 @@
  * [including the GNU Public Licence.]
  */
 
-#define NO_SHUTDOWN
-
 /*-----------------------------------------
    s_time - SSL client connection timer program
    Written and donated by Larry Streepy <stre...@healthcare.com>
@@ -341,11 +339,7 @@ s_time_main(int argc, char **argv)
                        while ((i = SSL_read(scon, buf, sizeof(buf))) > 0)
                                bytes_read += i;
                }
-#ifdef NO_SHUTDOWN
                SSL_set_shutdown(scon, SSL_SENT_SHUTDOWN | 
SSL_RECEIVED_SHUTDOWN);
-#else
-               SSL_shutdown(scon);
-#endif
                shutdown(SSL_get_fd(scon), SHUT_RDWR);
                close(SSL_get_fd(scon));
 
@@ -400,11 +394,7 @@ next:
                SSL_write(scon, buf, strlen(buf));
                while (SSL_read(scon, buf, sizeof(buf)) > 0);
        }
-#ifdef NO_SHUTDOWN
        SSL_set_shutdown(scon, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN);
-#else
-       SSL_shutdown(scon);
-#endif
        shutdown(SSL_get_fd(scon), SHUT_RDWR);
        close(SSL_get_fd(scon));
 
@@ -434,11 +424,7 @@ next:
                        while ((i = SSL_read(scon, buf, sizeof(buf))) > 0)
                                bytes_read += i;
                }
-#ifdef NO_SHUTDOWN
                SSL_set_shutdown(scon, SSL_SENT_SHUTDOWN | 
SSL_RECEIVED_SHUTDOWN);
-#else
-               SSL_shutdown(scon);
-#endif
                shutdown(SSL_get_fd(scon), SHUT_RDWR);
                close(SSL_get_fd(scon));
 

Reply via email to