[openssl-dev] [openssl.org #4212] Compilation of master branch fails with 's_nbio' undeclared (first use in this function).

Juan Manuel Guerrero via RT rt at openssl.org
Sat Jan 2 01:57:18 UTC 2016


I have tried to compile the muster branch using DJGPP and the compilation
failed with error:
   s_server.c:397:5: error: 's_nbio' undeclared (first use in this function)

A comparision with OpenSSL_1_0_2-stable, where everthing works flawlessly,
shows that s_nbio is only used iff the macro FIONBIO is defined.  For
some reason the #ifdef FIONBIO/#endif in functions s_server_init and
s_server_main have been removed in the master branch.  At the same time
the static definition of s_nbio at line 230 is enclosed by a #ifdef FIONBIO/#endif.
This has the consequence that it becomes impossible to compile the
application for all systems that do not define FIONBIO.  I have added
#ifdef FIONBIO/#endif where appropriate.  The bottom line of this is
that the usage of #ifdef FIONBIO/#endif is not consistent through the
code.  I also do not understand if the assumption is licit that all
systems have to support non-blocking IO.  But that seems to me to be
the consecuence if you remove the #ifdef FIONBIO/#endif from the code.
Please see patch against master branch.

Regards,
Juan M. Guerrero


diff --git a/apps/s_server.c b/apps/s_server.c
index e0eac55..4669723 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -393,7 +393,9 @@ static void s_server_init(void)
      s_cert_file2 = TEST_CERT2;
      s_key_file2 = NULL;
      ctx2 = NULL;
+#ifdef FIONBIO
      s_nbio = 0;
+#endif
      s_nbio_test = 0;
      ctx = NULL;
      www = 0;
@@ -1224,10 +1226,15 @@ int s_server_main(int argc, char *argv[])
              vfyCAfile = opt_arg();
              break;
          case OPT_NBIO:
+#ifdef FIONBIO
              s_nbio = 1;
+#endif
              break;
          case OPT_NBIO_TEST:
-            s_nbio = s_nbio_test = 1;
+#ifdef FIONBIO
+            s_nbio = 1;
+#endif
+            s_nbio_test = 1;
              break;
          case OPT_IGN_EOF:
              s_ign_eof = 1;

_______________________________________________
openssl-bugs-mod mailing list
openssl-bugs-mod at openssl.org
https://mta.openssl.org/mailman/listinfo/openssl-bugs-mod



More information about the openssl-dev mailing list