WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 03 of 24] xenpaging: use PERROR to print errno

To: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 03 of 24] xenpaging: use PERROR to print errno
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Tue, 4 Oct 2011 19:19:30 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 04 Oct 2011 10:20:15 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1317748778; l=725; s=domk; d=aepfle.de; h=In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version: References:Subject:Cc:To:From:Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=Ws1VKbyqIEwNJSpV7Sb/hB7QaUw=; b=ucbG9x17ujWmW3wh+k/2WldNgF25Jt1we1RGFRVbhplmKMnEAdqsHwajBD8rzIB9+zl Z2rFiKmlHw83Le0GtRlr0hd+5HaF408LaK8VKBGlDVVELkUNRNXAH8F/nvi2ywMQNqW/+ qEl+7A9RJc2/8xdipfA0hE0efNYHnZ0w7nw=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <CAFLBxZYdDmYCWSOoWc2FfiHSrh9ybnJwHNFCSTrqhDuXrNXk_w@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1317657277@xxxxxxxxxxxx> <ee4c4c7699e0de2b6bdd.1317657280@xxxxxxxxxxxx> <CAFLBxZYdDmYCWSOoWc2FfiHSrh9ybnJwHNFCSTrqhDuXrNXk_w@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.21.rev5535 (2011-07-01)
On Tue, Oct 04, George Dunlap wrote:

> On Mon, Oct 3, 2011 at 4:54 PM, Olaf Hering <olaf@xxxxxxxxx> wrote:

> >     seek_ret = lseek(fd, i << PAGE_SHIFT, SEEK_SET);
> > +    if (seek_ret == -1)
> > +    {
> > +        ret = -errno;
> > +        goto err;
> > +    }
> 
> Wouldn't it be more idiomatic to make both this check and the other
> check in the function:
> * check for seek_ret < 0 (rather than -1)

The man page said its -1, now that I read it again it says (off_t)-1, so
my change above should be updated to comply with the man page.

> * make file_op() return -1
> * Let the caller read errno?  (Rather than returning -errno)?

Yes, I will change this in a new patch.

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>