diff -ur openssl-1.0.0-beta2/apps/apps.c openssl/apps/apps.c
--- openssl-1.0.0-beta2/apps/apps.c 2009-04-03 13:06:35.000000000 -0400
+++ openssl/apps/apps.c 2009-05-08 13:06:39.000000000 -0400
@@ -109,10 +109,12 @@
*
*/
+#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 2 /* On VMS, you need to define this to get
the declaration of fileno(). The value
2 is to make sure no function defined
in POSIX-2 is left undefined. */
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff -ur openssl-1.0.0-beta2/crypto/ui/ui_openssl.c
openssl/crypto/ui/ui_openssl.c
--- openssl-1.0.0-beta2/crypto/ui/ui_openssl.c 2008-12-22 09:54:11.000000000
-0400
+++ openssl/crypto/ui/ui_openssl.c 2009-05-08 13:06:18.000000000 -0400
@@ -122,7 +122,9 @@
* sigaction and fileno included. -pedantic would be more appropriate for
* the intended purposes, but we can't prevent users from adding -ansi.
*/
-#define _POSIX_C_SOURCE 1
+#ifndef _POSIX_C_SOURCE
+#define _POSIX_C_SOURCE 2
+#endif
#include <signal.h>
#include <stdio.h>
#include <string.h>As I explained in a recent email(*), openssl/apps/apps.c and openssl/crypto/ui/ui_openssl.c unconditionally define the _POSIX_C_SOURCE macro. This causes compilation warnings for platforms where CFLAGS also defines _POSIX_C_SOURCE. (The warning whines about the redundant definition in the C programs). Additionally, ui_openssl.c defines this macro to the value "1", which is not a recognized value according to my understanding of the POSIX family of standards. The attached patch corrects both of these issues. Both programs now conditionally define the macro, and both use the same value, namely, "2". I tested this patch against the openssl-1.0.0-beta2 release, and I respectfully request that it be applied to that branch. <<openssl-100b2.posix.txt>> (*) = http://marc.info/?l=openssl-dev&m=124120127605328&w=2 Thanks PG -- Paul Green, Senior Technical Consultant, Stratus Technologies. Voice: +1 978-461-7557; FAX: +1 978-461-3610; Mobile: +1 (978) 235-2451; AIM: PaulGreenTitle: [patch] Fix refs to _POSIX_C_SOURCE
As I explained in a recent email(*), openssl/apps/apps.c and openssl/crypto/ui/ui_openssl.c unconditionally define the _POSIX_C_SOURCE macro. This causes compilation warnings for platforms where CFLAGS also defines _POSIX_C_SOURCE. (The warning whines about the redundant definition in the C programs). Additionally, ui_openssl.c defines this macro to the value "1", which is not a recognized value according to my understanding of the POSIX family of standards.
The attached patch corrects both of these issues. Both programs now conditionally define the macro, and both use the same value, namely, "2".
I tested this patch against the openssl-1.0.0-beta2 release, and I respectfully request that it be applied to that branch.
<<openssl-100b2.posix.txt>>
(*) = http://marc.info/?l=openssl-dev&m=124120127605328&w=2
Thanks
PG
--
Paul Green, Senior Technical Consultant, Stratus Technologies.
Voice: +1 978-461-7557; FAX: +1 978-461-3610; Mobile: +1 (978) 235-2451; AIM: PaulGreen
