Andrew Overholt 00bcd66
#define of _XOPEN_SOURCE is needed to obtain the header for ptsname.
Andrew Overholt 00bcd66
Andrew Overholt 00bcd66
if _XOPEN_SOURCE is not defined before including stdlib.h, a warning about
Andrew Overholt 00bcd66
a assignment from an integer to a pointer without a cast will occur.  This
Andrew Overholt 00bcd66
warning could actually cause problems in some circumstances, because the
e71a9fb
upper bits of the return value could, potentially, be set to zero before
Andrew Overholt 00bcd66
the assignment is made.
Andrew Overholt 00bcd66
Index: library/openpty.c
Andrew Overholt 00bcd66
===================================================================
Andrew Overholt 00bcd66
--- library.orig/openpty.c
Andrew Overholt 00bcd66
+++ library/openpty.c
Andrew Overholt 00bcd66
@@ -8,6 +8,10 @@
Andrew Overholt 00bcd66
  * Contributors:
Andrew Overholt 00bcd66
  *     QNX Software Systems - initial API and implementation
Andrew Overholt 00bcd66
  *******************************************************************************/
Andrew Overholt 00bcd66
+
Andrew Overholt 00bcd66
+
Andrew Overholt 00bcd66
+/* _XOPEN_SOURCE is needed to bring in the header for ptsname */
Andrew Overholt 00bcd66
+#define _XOPEN_SOURCE
Andrew Overholt 00bcd66
 #include <sys/types.h>
Andrew Overholt 00bcd66
 #include <sys/stat.h>
Andrew Overholt 00bcd66
 #include <sys/ioctl.h>