From: Ian Campbell Subject: Re: [PATCH v8 20/20] xenctx: Ensure errno is not zero on error in xc_translate_foreign_address() Date: Tue, 1 Apr 2014 15:30:17 +0100 Message-ID: <1396362617.8667.215.camel@kazak.uk.xensource.com> References: <1395947147-5262-1-git-send-email-dslutz@verizon.com> <1395947147-5262-21-git-send-email-dslutz@verizon.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1395947147-5262-21-git-send-email-dslutz@verizon.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Don Slutz Cc: George Dunlap , Stefano Stabellini , Ian Jackson , Jan Beulich , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, 2014-03-27 at 15:05 -0400, Don Slutz wrote: > This is because xc_translate_foreign_address() returns 0 in both the > error case and when 0 is the mfn. By making sure that errno is set > callers can now determine if it is an error or not. I think it would be preferable to change the function to return the translated address via an output pointer and make the formal return be an int 0 (success) or -1 (error, sets errno). That would be both more normal and remove all the frobbing around with errno. Ian.