[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v20210601 04/38] tools: add readv_exact to libxenctrl
 
- To: Juergen Gross <jgross@xxxxxxxx>
 
- From: Olaf Hering <olaf@xxxxxxxxx>
 
- Date: Wed, 2 Jun 2021 12:57:10 +0200
 
- Arc-authentication-results: i=1; strato.com;    dkim=none
 
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1622631442;    s=strato-dkim-0002; d=strato.com;    h=References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Cc:Date:    From:Subject:Sender;    bh=F8geIRzygIdHjqWInOe5Mba3yEzQCyuFZhoHbRoHsQc=;    b=mtDXc14+ir8G325gupV6sIF9UzxFyfDzPpCeJxw5qhViRCPCgt9DmvPZ4wUWqedgRI    xYSiC/aYJ0466kVToBpVU/tX0xevvqiTAfS/UL0KdFVELQ0L+/ON1YGPD/wZNwInT0er    UazSA6qZPYhHIzAGHyc7qXwZrlRAGXGq34FW9DDI1pKeao/wXVJWRX1w4ROjkidkJ8LA    XAnLXOzL+SHi8n6OCeBKq/NGrfdQ87bL3gjIIT7VNxGU4apCvssC3NE9z4/N6LDgpmKY    zBP0UwYKoZdZM7gHmwTofRs68n4Iw9Y8Jum6d8RHpqaWBoxi1U1ycKr+x2t0z76zBSIW    xVLw==
 
- Arc-seal: i=1; a=rsa-sha256; t=1622631442; cv=none;    d=strato.com; s=strato-dkim-0002;    b=byYJhIr1Zrx2IYXFJo2Kd+qNouxpnra3+21TAVrii5d0SP1lZS+H3AGjmSGk80rHpv    a3Cmga07VPtLTii+VUoqwhGoH3i4NB+oRIAm+g2WGIznkAqk/vprUsOMxDHypjQ27pTk    M4ey/0GusjHTQIW+JXXfvSEQBZVc6uz6CvaJKayBq5MqpNBcXISAUcOrW52hB7yAJxlb    uRGxT4xoq3F2DKsFZdOaaFVQ0a1/y/W4iyeuT0lIXE/4Fdz+F7/C0wIBuk+wg5kWz23Q    3pS4pd+26AmVCmnGkaMQQii3V6Bq4VjBWoAGwhknJa08+HnqDGF54tZLvGLnQpUOKcXw    8Jpg==
 
- Authentication-results: strato.com;    dkim=none
 
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
 
- Delivery-date: Wed, 02 Jun 2021 10:57:36 +0000
 
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
 
 
 
Am Wed, 2 Jun 2021 08:30:08 +0200
schrieb Juergen Gross <jgross@xxxxxxxx>:
> On 01.06.21 18:10, Olaf Hering wrote:
> > +int readv_exact(int fd, const struct iovec *iov, int iovcnt)
> > +        if ( len <= 0 )
> > +        {
> > +            rc = -1;  
> Is EOF really an error?
I think yes, that's what "exact" implies IMO.
> This will stop the loop, even if idx hasn't reached iovcnt.
Yes, it will trigger yet another readv().
The "while" might be a leftover from a variant which used repeated read_exact 
to finish the function. It should become a "if", and the "len = 0" can be 
removed.
Olaf
Attachment:
pgpPjYiNK3Bsk.pgp 
Description: Digitale Signatur von OpenPGP 
 
    
     |