if(nread = read(fd,buf+(count-nleft),nleft) < 0) 与
if((nread = read(fd,buf+(count-nleft),nleft)) < 0)
有什么不同呢
第一句意思为nread = (read(fd,buf+(count-nleft),nleft) < 0),即read的数据大于0时,nread反而为0,导致与程序的本意不符,本意为检查程序read返回值是否<0