SUMMARY: Tcl 7.5/Tk 4.1 on DU 3.2c

From: Jeff Putsch <putsch_at_uicc.com>
Date: Fri, 3 May 1996 13:27:03 -0400

Howdy,

Thanks to Albert De Knuydt for pointing out that comp.lang.tcl recently had a
posting correcting this problem. Thanks also to Drew Kramer for offering to
find and fix the problem for me. Drew asked where I found Tcl 7.5 so here are
some pointers:

  http://www.sunlabs.com/research/tcl

contains pointers to obtaining the Tcl/Tk releases.

  ftp://ftp.sunlabs.com/pub/tcl

contains the latest releases of Tcl/Tk.

My original question was:

>Has anyone built this successfully yet?
>
>The compilation proceeds smoothly, but when I run 'make test' the socket
tests
>hang. I have narrowed it down to test 2.1 of the socket tests (at least
that's
> the first test to hang).
>
>Any help will be greatly appreciated.
>

I've also enclosed a copy of the patch Albert was referring to.

Thanks again for the help!

Jeff.


Subject: [BUG FIX] Tcl 7.5, DEC Alpha 3.2, CreateSocketAddress()
From: man_at_imrryr.magwien.gv.at (Andreas Manessinger)
Date: 1996/04/23
Message-Id: <x068argm32.fsf_at_imrryr.adv.magwien.gv.at>
Sender: man_at_imrryr.adv.magwien.gv.at
Organization: Gemeinde Wien MD-ADV/Ma; A-1010 Wien; Austria
Newsgroups: comp.lang.tcl


In the current distribution `CreateSocketAddress()' fails on Alphas
(and maybe on other 64 bit machines too) if the host is specified by
name. This means, that the command `socket localhost echo' fails, but
not so `socket 127.0.0.1 echo'.

This happens on `alpha-dec-osf3.2' when configuring with
`configure --enable-shared' using `cc' as compiler.

The problem is, that on the Alpha internet addresses in <netinet/in.h>
are defined as

        struct in_addr {
                u_int s_addr;
        };

but everywhere else as a variant of

        struct in_addr {
                u_long s_addr;
        };

After trying to convert the string given by the user to an internet
address, the value of the address is compared with `(unsigned long) -1'
to check for failure. It is better to drop the cast and let the
compiler decide how to do it right.

The following patch fixes the problem for me:

*** tcl7.5/unix/tclUnixChan.c Tue Apr 23 14:03:59 1996
--- tcl7.5/unix/tclUnixChan.c.orig Fri Apr 19 02:05:40 1996
***************
*** 1380,1386 ****
        addr.s_addr = INADDR_ANY;
      } else {
          addr.s_addr = inet_addr(host);
! if (addr.s_addr == -1) {
              hostent = gethostbyname(host);
              if (hostent != NULL) {
                  memcpy((VOID *) &addr,
--- 1380,1386 ----
        addr.s_addr = INADDR_ANY;
      } else {
          addr.s_addr = inet_addr(host);
! if (addr.s_addr == (unsigned long) -1) {
              hostent = gethostbyname(host);
              if (hostent != NULL) {
                  memcpy((VOID *) &addr,
-- 
Andreas Manessinger                                     man_at_adv.magwien.gv.at
-----------------------------------------------------------------------------
"Time is a jet plane, it moves too fast"
                                           Bob Dylan, -You're a big girl now-


-----------------------------------------------------------------------------
Jeff Putsch | Internet: putsch_at_uicc.com
Unitrode Integrated Circuits Corp. | Fax : (US) 603-429-8564
Merrimack, NH USA | Voice : (US) 603-429-8626 (daytime)
Received on Fri May 03 1996 - 20:09:31 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:46 NZDT