From f25b19db8d50748d4f75272ae324cad27788d9b3 Mon Sep 17 00:00:00 2001 From: Paul Traina Date: Thu, 27 Nov 1997 19:49:05 +0000 Subject: Import TCL v8.0 PL2. --- contrib/tcl/unix/Makefile.in | 32 ++++++++-- contrib/tcl/unix/configure | 135 +++++++++++++++++++++++++--------------- contrib/tcl/unix/configure.in | 12 +++- contrib/tcl/unix/porting.notes | 30 +++++++-- contrib/tcl/unix/tclUnixChan.c | 10 +-- contrib/tcl/unix/tclUnixFCmd.c | 29 ++++----- contrib/tcl/unix/tclUnixNotfy.c | 11 ++-- contrib/tcl/unix/tclUnixPipe.c | 10 +-- contrib/tcl/unix/tclUnixSock.c | 8 ++- contrib/tcl/unix/tclUnixTest.c | 6 +- contrib/tcl/unix/tclUnixTime.c | 4 +- contrib/tcl/unix/tclXtTest.c | 4 +- 12 files changed, 188 insertions(+), 103 deletions(-) (limited to 'contrib/tcl/unix') diff --git a/contrib/tcl/unix/Makefile.in b/contrib/tcl/unix/Makefile.in index 8d2d7c8481096..6b15ff545ac25 100644 --- a/contrib/tcl/unix/Makefile.in +++ b/contrib/tcl/unix/Makefile.in @@ -5,7 +5,7 @@ # "autoconf" program (constructs like "@foo@" will get replaced in the # actual Makefile. # -# SCCS: @(#) Makefile.in 1.187 97/08/15 10:23:55 +# SCCS: @(#) Makefile.in 1.190 97/11/05 10:57:38 # Current Tcl version; used in various names. @@ -73,12 +73,7 @@ MANN_INSTALL_DIR = $(MAN_INSTALL_DIR)/mann # To change the compiler switches, for example to change from -O # to -g, change the following line: -# On systems where both getcwd(3) and getwd(3) exist, check the man -# page and if getcwd, like on Solaris, uses popen to pwd(1) -# add -DUSEGETWD to the flags so getwd will be used instead. CFLAGS = -O -# Solaris recommended: -#CFLAGS = -O -DUSEGETWD # To disable ANSI-C procedure prototypes reverse the comment characters # on the following lines: @@ -890,6 +885,11 @@ dist: $(UNIX_DIR)/configure cp -p $(UNIX_DIR)/dltest/configure.in $(UNIX_DIR)/dltest/configure \ $(UNIX_DIR)/dltest/README $(DISTDIR)/unix/dltest +# +# The following target can only be used for non-patch releases. Use +# the "allpatch" target below for patch releases. +# + alldist: dist rm -f /proj/tcl/dist/$(DISTNAME).tar.Z \ /proj/tcl/dist/$(DISTNAME).tar.gz \ @@ -898,6 +898,26 @@ alldist: dist gzip -9 -c $(DISTNAME).tar > $(DISTNAME).tar.gz; \ compress $(DISTNAME).tar; zip -r8 $(ZIPNAME) $(DISTNAME) +# +# The target below is similar to "alldist" except it works for patch +# releases. It is needed because patch releases are peculiar: the +# patch designation appears in the name of the compressed file +# (e.g. tcl8.0p1.tar.gz) but the extracted source directory doesn't +# include the patch designation (e.g. tcl8.0). +# + +allpatch: dist + rm -f /proj/tcl/dist/$(DISTNAME).tar.Z \ + /proj/tcl/dist/$(DISTNAME).tar.gz \ + /proj/tcl/dist/$(ZIPNAME) + mv /proj/tcl/dist/tcl${VERSION} /proj/tcl/dist/old + mv /proj/tcl/dist/$(DISTNAME) /proj/tcl/dist/tcl${VERSION} + cd /proj/tcl/dist; tar cf $(DISTNAME).tar tcl${VERSION}; \ + gzip -9 -c $(DISTNAME).tar > $(DISTNAME).tar.gz; \ + compress $(DISTNAME).tar; zip -r8 $(ZIPNAME) tcl${VERSION} + mv /proj/tcl/dist/tcl${VERSION} /proj/tcl/dist/$(DISTNAME) + mv /proj/tcl/dist/old /proj/tcl/dist/tcl${VERSION} + # # Target to create a Macintosh version of the distribution. This will # do a normal distribution and then massage the output to prepare it diff --git a/contrib/tcl/unix/configure b/contrib/tcl/unix/configure index 0609faf994720..35cee45363c1f 100755 --- a/contrib/tcl/unix/configure +++ b/contrib/tcl/unix/configure @@ -404,12 +404,12 @@ else fi -# SCCS: @(#) configure.in 1.140 97/08/12 10:36:18 +# SCCS: @(#) configure.in 1.144 97/11/20 12:39:44 TCL_VERSION=8.0 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=0 -TCL_PATCH_LEVEL="" +TCL_PATCH_LEVEL="p2" VERSION=${TCL_VERSION} if test "${prefix}" = "NONE"; then @@ -621,7 +621,7 @@ EOF fi done -# Nb: if getcwd uses popen and pwd(1) (like Solaris) we should really +# Nb: if getcwd uses popen and pwd(1) (like SunOS 4) we should really # define USEGETWD even if the posix getcwd exists. Add a test ? for ac_func in opendir strstr @@ -1999,6 +1999,43 @@ EOF fi +#-------------------------------------------------------------------- +# Some systems (e.g., IRIX 4.0.5) lack the st_blksize field +# in struct stat. +#-------------------------------------------------------------------- +echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +int main() { return 0; } +int t() { +struct stat s; s.st_blksize; +; return 0; } +EOF +if eval $ac_compile; then + rm -rf conftest* + ac_cv_struct_st_blksize=yes +else + rm -rf conftest* + ac_cv_struct_st_blksize=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6 +if test $ac_cv_struct_st_blksize = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_ST_BLKSIZE 1 +EOF + +fi + + #-------------------------------------------------------------------- # On some systems strstr is broken: it returns a pointer even # even if the original string is empty. @@ -2009,7 +2046,7 @@ if test "$cross_compiling" = yes; then tcl_ok=no else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext < conftest.$ac_ext <&6 else cat > conftest.$ac_ext < conftest.$ac_ext <&6 else cat > conftest.$ac_ext < conftest.$ac_ext <&6 else cat > conftest.$ac_ext < #include @@ -2326,7 +2363,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2344,7 +2381,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2365,7 +2402,7 @@ if test "$cross_compiling" = yes; then ac_cv_header_stdc=no else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2399,7 +2436,7 @@ if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2430,7 +2467,7 @@ if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2461,7 +2498,7 @@ if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2492,7 +2529,7 @@ if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -2532,7 +2569,7 @@ if eval "test \"`echo '$''{'ac_cv_func_opendir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 cat > conftest.$ac_ext < #include @@ -2623,7 +2660,7 @@ fi echo $ac_n "checking matherr support""... $ac_c" 1>&6 cat > conftest.$ac_ext < int main() { return 0; } @@ -2665,7 +2702,7 @@ if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < conftest.$ac_ext < @@ -2772,7 +2809,7 @@ if eval "test \"`echo '$''{'ac_cv_func_strncasecmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&6 else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext <&6 cat > conftest.$ac_ext < EOF @@ -3029,7 +3066,7 @@ else ac_save_LIBS="$LIBS" LIBS="-linet $LIBS" cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext < EOF @@ -3101,7 +3138,7 @@ else if test "$GCC" = yes; then # GCC predefines this symbol on systems where it applies. cat > conftest.$ac_ext <&2; exit 1; } else cat > conftest.$ac_ext <&6 cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext < conftest.$ac_ext <&6 else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&6 else cat > conftest.$ac_ext < EOF @@ -3725,7 +3762,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -3908,7 +3945,7 @@ fi echo $ac_n "checking for ld accepts -Bexport flag""... $ac_c" 1>&6 LDFLAGS="${LDFLAGS} -Wl,-Bexport" cat > conftest.$ac_ext <&6 cat > conftest.$ac_ext < int main() { return 0; } @@ -3995,7 +4032,7 @@ EOF else echo $ac_n "checking a.out.h""... $ac_c" 1>&6 cat > conftest.$ac_ext < int main() { return 0; } @@ -4032,7 +4069,7 @@ EOF else echo $ac_n "checking sys/exec_aout.h""... $ac_c" 1>&6 cat > conftest.$ac_ext < int main() { return 0; } @@ -4143,7 +4180,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -4179,7 +4216,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF diff --git a/contrib/tcl/unix/configure.in b/contrib/tcl/unix/configure.in index 27fa8b1bd31b7..ee36dc4f7906c 100755 --- a/contrib/tcl/unix/configure.in +++ b/contrib/tcl/unix/configure.in @@ -2,12 +2,12 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tcl installation dnl to configure the system for the local environment. AC_INIT(../generic/tcl.h) -# SCCS: @(#) configure.in 1.140 97/08/12 10:36:18 +# SCCS: @(#) configure.in 1.144 97/11/20 12:39:44 TCL_VERSION=8.0 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=0 -TCL_PATCH_LEVEL="" +TCL_PATCH_LEVEL="p2" VERSION=${TCL_VERSION} if test "${prefix}" = "NONE"; then @@ -36,7 +36,7 @@ AC_C_CROSS # Check if Posix compliant getcwd exists, if not we'll use getwd. AC_CHECK_FUNCS(getcwd, , AC_DEFINE(USEGETWD)) -# Nb: if getcwd uses popen and pwd(1) (like Solaris) we should really +# Nb: if getcwd uses popen and pwd(1) (like SunOS 4) we should really # define USEGETWD even if the posix getcwd exists. Add a test ? AC_REPLACE_FUNCS(opendir strstr) @@ -268,6 +268,12 @@ if test $libbsd = yes; then AC_DEFINE(USE_DELTA_FOR_TZ) fi +#-------------------------------------------------------------------- +# Some systems (e.g., IRIX 4.0.5) lack the st_blksize field +# in struct stat. +#-------------------------------------------------------------------- +AC_STRUCT_ST_BLKSIZE + #-------------------------------------------------------------------- # On some systems strstr is broken: it returns a pointer even # even if the original string is empty. diff --git a/contrib/tcl/unix/porting.notes b/contrib/tcl/unix/porting.notes index 39b35cbbd583a..2d0a403900511 100644 --- a/contrib/tcl/unix/porting.notes +++ b/contrib/tcl/unix/porting.notes @@ -11,7 +11,7 @@ cases the person's name and e-mail address are listed. I'm interested in getting new porting information to add to the file; please mail updates to "john.ousterhout@eng.sun.com". -This file reflects information provided for Tcl 7.4 and later releases. +This file reflects information provided for Tcl 7.4 and later releases (8.x). If there is no information for your configuration in this file, check the file "porting.old" too; it contains information that was submitted for Tcl 7.3 and earlier releases, and some of that information @@ -19,14 +19,14 @@ may still be valid. A new porting database has recently become available on the Web at the following URL: - http://www.sunlabs.com/cgi-bin/tcl/info.4.0 -This page provides information about the platforms on which Tcl 7.4 -and Tk 4.0 have been compiled and what changes were needed to get Tcl + http://www.sunlabs.com/cgi-bin/tcl/info.8.0 +This page provides information about the platforms on which Tcl and +and Tk 8.0 have been compiled and what changes were needed to get Tcl and Tk to compile. You can also add new entries to that database when you install Tcl and Tk on a new platform. The Web database is likely to be more up-to-date than this file. -sccsid = SCCS: @(#) porting.notes 1.18 96/12/31 14:50:27 +sccsid = SCCS: @(#) porting.notes 1.20 97/11/03 09:43:40 -------------------------------------------- Solaris, various versions @@ -50,6 +50,26 @@ if you run into problems, edit the Makefile after "configure" is run and add "-DNO_DIRENT_H=1" to the definitions of DEFS. Do this before compiling. +-------------------------------------------- +SunOS 4 and potentially other OSes +-------------------------------------------- + +On systems where both getcwd(3) and getwd(3) exist, check the man +page and if getcwd, like on SunOS 4, uses popen to pwd(1) +add -DUSEGETWD to the flags CFLAGS so getwd will be used instead. + +That is, change the CFLAGS = -O line so it reads +CFLAGS = -O -DUSEGETWD + +-------------------------------------------- +Linux, ELF, various versions/distributions +-------------------------------------------- + +If ./configure --enable-shared complains it can not do a shared +library you might have to make the following symbolic link: +ln -s /lib/libdl.so.1 /lib/libdl.so +then remove config.cache and re run configure. + -------------------------------------------- Pyramid DC/OSx SVr4, DC/OSx version 94c079 -------------------------------------------- diff --git a/contrib/tcl/unix/tclUnixChan.c b/contrib/tcl/unix/tclUnixChan.c index 2e53440bb1d4d..2c0e9961f8342 100644 --- a/contrib/tcl/unix/tclUnixChan.c +++ b/contrib/tcl/unix/tclUnixChan.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * SCCS: @(#) tclUnixChan.c 1.203 97/06/20 13:03:18 + * SCCS: @(#) tclUnixChan.c 1.207 97/11/04 14:45:29 */ #include "tclInt.h" /* Internal definitions for Tcl. */ @@ -1713,7 +1713,7 @@ TcpGetOptionProc(instanceData, interp, optionName, dsPtr) } Tcl_DStringAppendElement(dsPtr, inet_ntoa(sockname.sin_addr)); hostEntPtr = gethostbyaddr((char *) &(sockname.sin_addr), - sizeof(peername.sin_addr), AF_INET); + sizeof(sockname.sin_addr), AF_INET); if (hostEntPtr != (struct hostent *) NULL) { Tcl_DStringAppendElement(dsPtr, hostEntPtr->h_name); } else { @@ -2360,6 +2360,7 @@ Tcl_GetOpenFile(interp, string, forWriting, checkUsage, filePtr) Tcl_Channel chan; int chanMode; Tcl_ChannelType *chanTypePtr; + ClientData data; int fd; FILE *f; @@ -2387,8 +2388,9 @@ Tcl_GetOpenFile(interp, string, forWriting, checkUsage, filePtr) if ((chanTypePtr == &fileChannelType) || (chanTypePtr == &tcpChannelType) || (strcmp(chanTypePtr->typeName, "pipe") == 0)) { if (Tcl_GetChannelHandle(chan, - (forWriting ? TCL_WRITABLE : TCL_READABLE), (ClientData*) &fd) - == TCL_OK) { + (forWriting ? TCL_WRITABLE : TCL_READABLE), + (ClientData*) &data) == TCL_OK) { + fd = (int) data; /* * The call to fdopen below is probably dangerous, since it will diff --git a/contrib/tcl/unix/tclUnixFCmd.c b/contrib/tcl/unix/tclUnixFCmd.c index 51224e68f8868..3ec1a69d9f46d 100644 --- a/contrib/tcl/unix/tclUnixFCmd.c +++ b/contrib/tcl/unix/tclUnixFCmd.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * SCCS: @(#) tclUnixFCmd.c 1.29 97/06/16 16:28:25 + * SCCS: @(#) tclUnixFCmd.c 1.31 97/10/13 16:51:14 * * Portions of this code were derived from NetBSD source code which has * the following copyright notice: @@ -363,7 +363,12 @@ CopyFile(src, dst, srcStatBufPtr) return TCL_ERROR; } +#if HAVE_ST_BLKSIZE blockSize = srcStatBufPtr->st_blksize; +#else + blockSize = 4096; +#endif + buffer = ckalloc(blockSize); while (1) { nread = read(srcFd, buffer, blockSize); @@ -937,16 +942,11 @@ GetGroupAttribute(interp, objIndex, fileName, attributePtrPtr) groupPtr = getgrgid(statBuf.st_gid); if (groupPtr == NULL) { - endgrent(); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "could not get group for file \"", fileName, "\": ", - Tcl_PosixError(interp), (char *) NULL); - return TCL_ERROR; + *attributePtrPtr = Tcl_NewIntObj(statBuf.st_gid); + } else { + *attributePtrPtr = Tcl_NewStringObj(groupPtr->gr_name, -1); } - - *attributePtrPtr = Tcl_NewStringObj(groupPtr->gr_name, -1); endgrent(); - return TCL_OK; } @@ -986,16 +986,11 @@ GetOwnerAttribute(interp, objIndex, fileName, attributePtrPtr) pwPtr = getpwuid(statBuf.st_uid); if (pwPtr == NULL) { - endpwent(); - Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), - "could not get owner for file \"", fileName, "\": ", - Tcl_PosixError(interp), (char *) NULL); - return TCL_ERROR; + *attributePtrPtr = Tcl_NewIntObj(statBuf.st_uid); + } else { + *attributePtrPtr = Tcl_NewStringObj(pwPtr->pw_name, -1); } - - *attributePtrPtr = Tcl_NewStringObj(pwPtr->pw_name, -1); endpwent(); - return TCL_OK; } diff --git a/contrib/tcl/unix/tclUnixNotfy.c b/contrib/tcl/unix/tclUnixNotfy.c index 857454c65da24..1a866804a3528 100644 --- a/contrib/tcl/unix/tclUnixNotfy.c +++ b/contrib/tcl/unix/tclUnixNotfy.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * SCCS: @(#) tclUnixNotfy.c 1.42 97/07/02 20:55:44 + * SCCS: @(#) tclUnixNotfy.c 1.44 97/11/05 13:02:20 */ #include "tclInt.h" @@ -266,7 +266,8 @@ Tcl_DeleteFileHandler(fd) int fd; /* Stream id for which to remove callback procedure. */ { FileHandler *filePtr, *prevPtr; - int index, bit, mask, i; + int index, bit, i; + unsigned long flags; if (!initialized) { InitNotifier(); @@ -310,12 +311,12 @@ Tcl_DeleteFileHandler(fd) if (fd+1 == notifier.numFdBits) { for (notifier.numFdBits = 0; index >= 0; index--) { - mask = notifier.checkMasks[index] + flags = notifier.checkMasks[index] | (notifier.checkMasks+MASK_SIZE)[index] | (notifier.checkMasks+2*(MASK_SIZE))[index]; - if (mask) { + if (flags) { for (i = (NBBY*sizeof(fd_mask)); i > 0; i--) { - if (mask & (1 << (i-1))) { + if (flags & (((unsigned long)1) << (i-1))) { break; } } diff --git a/contrib/tcl/unix/tclUnixPipe.c b/contrib/tcl/unix/tclUnixPipe.c index f6d90d702cb22..83aa4e888e513 100644 --- a/contrib/tcl/unix/tclUnixPipe.c +++ b/contrib/tcl/unix/tclUnixPipe.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * SCCS: @(#) tclUnixPipe.c 1.36 97/05/14 13:24:24 + * SCCS: @(#) tclUnixPipe.c 1.37 97/10/31 17:23:37 */ #include "tclInt.h" @@ -22,7 +22,7 @@ * the same as NULL. */ -#define MakeFile(fd) ((TclFile)((fd)+1)) +#define MakeFile(fd) ((TclFile)(((int)fd)+1)) #define GetFd(file) (((int)file)-1) /* @@ -100,11 +100,11 @@ TclpMakeFile(channel, direction) Tcl_Channel channel; /* Channel to get file from. */ int direction; /* Either TCL_READABLE or TCL_WRITABLE. */ { - int fd; + ClientData data; - if (Tcl_GetChannelHandle(channel, direction, (ClientData *) &fd) + if (Tcl_GetChannelHandle(channel, direction, (ClientData *) &data) == TCL_OK) { - return MakeFile(fd); + return MakeFile((int)data); } else { return (TclFile) NULL; } diff --git a/contrib/tcl/unix/tclUnixSock.c b/contrib/tcl/unix/tclUnixSock.c index b917832ca8d52..c532993c19be4 100644 --- a/contrib/tcl/unix/tclUnixSock.c +++ b/contrib/tcl/unix/tclUnixSock.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * SCCS: @(#) tclUnixSock.c 1.7 97/07/24 17:54:02 + * SCCS: @(#) tclUnixSock.c 1.9 97/10/09 18:24:49 */ #include "tcl.h" @@ -47,11 +47,12 @@ static int hostnameInited = 0; * * Tcl_GetHostName -- * - * Get the network name for this machine, in a system dependent way. + * Returns the name of the local host. * * Results: * A string containing the network name for this machine, or - * an empty string if we can't figure out the name. + * an empty string if we can't figure out the name. The caller + * must not modify or free this string. * * Side effects: * None. @@ -72,6 +73,7 @@ Tcl_GetHostName() } #ifndef NO_UNAME + (VOID *) memset((VOID *) &u, (int) 0, sizeof(struct utsname)); if (uname(&u) > -1) { hp = gethostbyname(u.nodename); if (hp != NULL) { diff --git a/contrib/tcl/unix/tclUnixTest.c b/contrib/tcl/unix/tclUnixTest.c index 67717d02b771f..b1d16768dec91 100644 --- a/contrib/tcl/unix/tclUnixTest.c +++ b/contrib/tcl/unix/tclUnixTest.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * SCCS: @(#) tclUnixTest.c 1.4 97/05/14 13:24:29 + * SCCS: @(#) tclUnixTest.c 1.5 97/10/31 17:23:42 */ #include "tclInt.h" @@ -343,6 +343,7 @@ TestfilewaitCmd(clientData, interp, argc, argv) int mask, result, timeout; Tcl_Channel channel; int fd; + ClientData data; if (argc != 4) { Tcl_AppendResult(interp, "wrong # arguments: should be \"", argv[0], @@ -366,10 +367,11 @@ TestfilewaitCmd(clientData, interp, argc, argv) } if (Tcl_GetChannelHandle(channel, (mask & TCL_READABLE) ? TCL_READABLE : TCL_WRITABLE, - (ClientData*) &fd) != TCL_OK) { + (ClientData*) &data) != TCL_OK) { Tcl_SetResult(interp, "couldn't get channel file", TCL_STATIC); return TCL_ERROR; } + fd = (int) data; if (Tcl_GetInt(interp, argv[3], &timeout) != TCL_OK) { return TCL_ERROR; } diff --git a/contrib/tcl/unix/tclUnixTime.c b/contrib/tcl/unix/tclUnixTime.c index 0c6a5d0326081..ba8d984f31198 100644 --- a/contrib/tcl/unix/tclUnixTime.c +++ b/contrib/tcl/unix/tclUnixTime.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * SCCS: @(#) tclUnixTime.c 1.12 97/01/08 17:38:15 + * SCCS: @(#) tclUnixTime.c 1.13 97/10/31 15:04:58 */ #include "tclInt.h" @@ -127,7 +127,7 @@ TclpGetTimeZone (currentTime) #if defined(HAVE_TM_GMTOFF) && !defined (TCL_GOT_TIMEZONE) # define TCL_GOT_TIMEZONE time_t curTime = (time_t) currentTime; - struct tm *timeDataPtr = localtime(¤tTime); + struct tm *timeDataPtr = localtime(&curTime); int timeZone; timeZone = -(timeDataPtr->tm_gmtoff / 60); diff --git a/contrib/tcl/unix/tclXtTest.c b/contrib/tcl/unix/tclXtTest.c index bb232569cdcd7..1479412dd5eb5 100644 --- a/contrib/tcl/unix/tclXtTest.c +++ b/contrib/tcl/unix/tclXtTest.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * SCCS: @(#) tclXtTest.c 1.1 97/03/24 14:30:42 + * SCCS: @(#) tclXtTest.c 1.2 97/09/15 15:26:52 */ #include @@ -100,7 +100,7 @@ TesteventloopCmd(clientData, interp, argc, argv) done = 0; while (!done) { - XtProcessEvent(XtIMAll); + XtAppProcessEvent(TclSetAppContext(NULL), XtIMAll); } (void) Tcl_SetServiceMode(oldMode); framePtr = oldFramePtr; -- cgit v1.2.3