From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,10bf95f665757cee X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-03-10 23:42:42 PST Path: gmd.de!newsserver.jvnc.net!darwin.sura.net!howland.reston.ans.net!pipex!uknet!EU.net!sun4nl!philapd!apdnews!atperf.idca.tds.philips.nl!pb From: pb@idca.tds.philips.nl (Peter Brouwer) Newsgroups: comp.unix.osf.osf1 Subject: Re: sin_port weirdness in DEC OSF/1? Message-ID: Date: 11 Mar 94 07:42:42 GMT References: <2loa0b$sqk@vixen.cso.uiuc.edu> Sender: news@idca.tds.philips.nl Reply-To: pb@idca.tds.philips.nl (Peter Brouwer) Organization: Digital Equipment Corporation Apeldoorn, The Netherlands. In <2loa0b$sqk@vixen.cso.uiuc.edu> robm@ncsa.uiuc.edu (Rob McCool) writes: >int get_portnum(int sd,FILE *out) { > struct sockaddr addr; > int len; > > len = sizeof(struct sockaddr); > if(getsockname(sd,&addr,&len) < 0) > die(SERVER_ERROR,"could not get port number",out); > return(((struct sockaddr_in *)&addr)->sin_port); >} >Does anyone see anything wrong with this? Is this a bug in OSF/1, or a >mistake on my part which just happens to work on other systems? If it's an >OS bug, does anyone have a workaround? Might the fact that sin_port is a u_short and your function returns an int give problems? -- Regards, Peter Brouwer /\_/\ pb@idca.tds.philips.nl (0 0) -----------------------------------oOO--(_)--OOo---------------------------- # Digital Equipment Enterprise, / WorkGroup Systems, Office Product Set # DIGITAL : HLDEO1::BROUWER_P,829-4218 \ Dep Office Product Sets, P.O.Box 245, # PHONE:[+31][0]55 43 ext 4218,fax 9133 7300AE Apeldoorn, The Netherlands.