Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: Brian Haley <Brian.Haley@hp.com>
Subject: Re: Tru64 5.1A (and B) socket bug
Date: Fri, 24 Jan 2003 13:48:30 -0500	[thread overview]
Message-ID: <3E318A7E.53D33732@hp.com> (raw)
In-Reply-To: mky95bihq7.fsf@--you-know-what-to-remove--.franz.com

Kevin Layer wrote:
> 
> Anyone else run into this problem?  We upgraded to 5.1B to see if it
> was fixed, and it is not.
> 
> A C program to demonstrate the problem is below.

I had to modify this program to get it to work:

# diff -c bug.c bug2.c
*** 137,151 ****
      {
          toread = (len > 4096? 4096 : len);
  
!         if ((got= read(s,buffer+i,toread)) != toread) {
              printf("Wanted to read %d, got %d, errno = %d\n",
                     toread, got, errno);
              exit(1);
          }
  
!         len -= toread;
!         i += toread;
      }
  
      /* now get eof */
      if ((got=read(s,buffer,4096)) != 0) {
--- 142,157 ----
      {
          toread = (len > 4096? 4096 : len);
  
!         if ((got = read(s,buffer+i,toread)) < 0) {
              printf("Wanted to read %d, got %d, errno = %d\n",
                     toread, got, errno);
              exit(1);
          }
  
!         len -= got;
!         i += got;
      }
  
      /* now get eof */
      if ((got=read(s,buffer,4096)) != 0) {

read() isn't guaranteed to always return what you ask for.

I'll forward this on to someone else here more familiar with that
code, but to make sure your problem is addressed you should call
the support center and file a formal problem report.

-Brian Haley, Tru64 Unix Networking


  reply	other threads:[~2003-01-24 18:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-23 23:12 Tru64 5.1A (and B) socket bug Kevin Layer
2003-01-24 18:48 ` Brian Haley [this message]
2003-01-24 22:48   ` Kevin Layer
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox