]> granicus.if.org Git - openssl/commitdiff
apps/s_server.c: Avoid unused variable due to 'no-dtls'
authorRichard Levitte <levitte@openssl.org>
Thu, 26 Apr 2018 19:11:26 +0000 (21:11 +0200)
committerRichard Levitte <levitte@openssl.org>
Fri, 27 Apr 2018 09:11:12 +0000 (11:11 +0200)
Fixes #6098

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/6104)

(cherry picked from commit ff25dd1a47525c88500dd61cdeb27faaea6ee599)

apps/s_server.c

index 31c90fdd0e64782a349dff74b8a5dd15971c0184..96a74c441d34769c15918e9e7a2731e371fe0ff1 100644 (file)
@@ -2012,9 +2012,7 @@ static int sv_body(int s, int stype, unsigned char *context)
     SSL *con = NULL;
     BIO *sbio;
     struct timeval timeout;
-#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
-    struct timeval tv;
-#else
+#if !(defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS))
     struct timeval *timeoutp;
 #endif
 
@@ -2149,9 +2147,9 @@ static int sv_body(int s, int stype, unsigned char *context)
              * second and check for any keypress. In a proper Windows
              * application we wouldn't do this because it is inefficient.
              */
-            tv.tv_sec = 1;
-            tv.tv_usec = 0;
-            i = select(width, (void *)&readfds, NULL, NULL, &tv);
+            timeout.tv_sec = 1;
+            timeout.tv_usec = 0;
+            i = select(width, (void *)&readfds, NULL, NULL, &timeout);
             if (has_stdin_waiting())
                 read_from_terminal = 1;
             if ((i < 0) || (!i && !read_from_terminal))