Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!ucla-cs!zen!ucbvax!PESCADERO.STANFORD.EDU!mason From: mason@PESCADERO.STANFORD.EDU Newsgroups: comp.windows.x Subject: Header file problems. Message-ID: <8707232052.AA19934@ATHENA.MIT.EDU> Date: Thu, 23-Jul-87 16:46:22 EDT Article-I.D.: ATHENA.8707232052.AA19934 Posted: Thu Jul 23 16:46:22 1987 Date-Received: Sat, 25-Jul-87 08:52:26 EDT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 65 I'm not sure if anyone else has found/reported this bug, but I thought it would be a good idea to report it/ask about it. (XV10R4 on a VAX 8350, Ultrix-32 V2.0) In 4.3BSD systems which use the new structure definition for host entries has been changed, I have had some problem with XOpenDisplay crashing (in bcopy). What I did was change the reference from host_ptr->h_addr, (which transforms via cpp to host_ptr->h_addr_list[0]) to host_ptr->h_addr_list. I've posted context diff at the end of this note. I placed #ifdefs in it that should make it work on either type of system, but I only tested it with the change. (XV11-beta.1 on a VAX 8350, Ultrix-32 V2.0) Also, I've been having some problems under Ultrix 2.0 with the header file sys/type.h. Has anyone else experienced this problem? I suspect a bug in the compiler but cannot confirm this. Tony Mason Distributed Systems Group Stanford University mason@pescadero.stanford.edu -------- XOpenDisplay.c diff -------- *** XOpenDisplay.c Thu Jul 23 13:45:55 1987 --- ../Xlib/XOpenDisplay.c Wed Dec 24 06:08:57 1986 *************** *** 105,112 /* Set up the socket data. */ inaddr.sin_family = host_ptr->h_addrtype; ! #ifdef h_addr ! bcopy((char *)host_ptr->h_addr_list, (char *)&inaddr.sin_addr, sizeof(inaddr.sin_addr)); #else /* not h_addr */ --- 105,111 ----- /* Set up the socket data. */ inaddr.sin_family = host_ptr->h_addrtype; ! bcopy((char *)host_ptr->h_addr, (char *)&inaddr.sin_addr, sizeof(inaddr.sin_addr)); } else { *************** *** 109,119 bcopy((char *)host_ptr->h_addr_list, (char *)&inaddr.sin_addr, sizeof(inaddr.sin_addr)); - #else /* not h_addr */ - bcopy((char *)host_ptr->h_addr_list, - (char *)&inaddr.sin_addr, - sizeof(inaddr.sin_addr)); - #endif /* h_addr */ } else { inaddr.sin_family = AF_INET; } --- 108,113 ----- bcopy((char *)host_ptr->h_addr, (char *)&inaddr.sin_addr, sizeof(inaddr.sin_addr)); } else { inaddr.sin_family = AF_INET; }