Tcl Source Code

Artifact [7823d588ed]
Login

Artifact 7823d588ed92f1b12b242ca1b644b6348954a0e4:

Attachment "unixware.patch" to ticket [3607543fff] added by xenu536 2013-03-10 23:52:50.
diff -ru tcl_old/generic/tclInt.h tcl_new/generic/tclInt.h
--- tcl_old/generic/tclInt.h	2013-03-10 17:13:52.000000000 +0100
+++ tcl_new/generic/tclInt.h	2013-03-10 17:34:33.224038600 +0100
@@ -50,6 +50,9 @@
 #else
 #include <string.h>
 #endif
+#ifdef HAVE_STRINGS_H /* needed by SCO UnixWare */
+#include <strings.h>
+#endif
 #ifdef STDC_HEADERS
 #include <stddef.h>
 #else
diff -ru tcl_old/unix/tclUnixCompat.c tcl_new/unix/tclUnixCompat.c
--- tcl_old/unix/tclUnixCompat.c	2013-03-10 17:13:52.000000000 +0100
+++ tcl_new/unix/tclUnixCompat.c	2013-03-10 17:36:17.856705300 +0100
@@ -197,7 +197,11 @@
      */
 
     if (tsdPtr->pbuf == NULL) {
+#ifndef _SC_GETPW_R_SIZE_MAX /* needed by SCO UnixWare */
+	tsdPtr->pbuflen = -1;
+#else
 	tsdPtr->pbuflen = (int) sysconf(_SC_GETPW_R_SIZE_MAX);
+#endif
 	if (tsdPtr->pbuflen < 1) {
 	    tsdPtr->pbuflen = 1024;
 	}
@@ -277,7 +281,11 @@
      */
 
     if (tsdPtr->pbuf == NULL) {
+#ifndef _SC_GETPW_R_SIZE_MAX /* needed by SCO UnixWare */
+	tsdPtr->pbuflen = -1;
+#else
 	tsdPtr->pbuflen = (int) sysconf(_SC_GETPW_R_SIZE_MAX);
+#endif
 	if (tsdPtr->pbuflen < 1) {
 	    tsdPtr->pbuflen = 1024;
 	}
@@ -380,7 +388,11 @@
      */
 
     if (tsdPtr->gbuf == NULL) {
-	tsdPtr->gbuflen = (int) sysconf(_SC_GETGR_R_SIZE_MAX);
+#ifndef _SC_GETGR_R_SIZE_MAX /* needed by SCO UnixWare */
+    tsdPtr->gbuflen = -1;
+#else
+    tsdPtr->gbuflen = (int) sysconf(_SC_GETGR_R_SIZE_MAX);
+#endif
 	if (tsdPtr->gbuflen < 1) {
 	    tsdPtr->gbuflen = 1024;
 	}
@@ -460,7 +472,11 @@
      */
 
     if (tsdPtr->gbuf == NULL) {
+#ifndef _SC_GETGR_R_SIZE_MAX /* needed by SCO UnixWare */
+	tsdPtr->gbuflen = -1;
+#else
 	tsdPtr->gbuflen = (int) sysconf(_SC_GETGR_R_SIZE_MAX);
+#endif
 	if (tsdPtr->gbuflen < 1) {
 	    tsdPtr->gbuflen = 1024;
 	}