From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH] tools/libxl: Correctly check if libxl_get_scheduler has failed Date: Thu, 20 Mar 2014 15:09:41 +0000 Message-ID: <532B04B5.7040606@linaro.org> References: <1395272536-5157-1-git-send-email-julien.grall@linaro.org> <21290.60349.509788.373481@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WQebJ-0001Q6-0s for xen-devel@lists.xenproject.org; Thu, 20 Mar 2014 15:09:45 +0000 Received: by mail-wg0-f50.google.com with SMTP id x13so696131wgg.33 for ; Thu, 20 Mar 2014 08:09:43 -0700 (PDT) In-Reply-To: <21290.60349.509788.373481@mariner.uk.xensource.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: Ian Jackson Cc: xen-devel@lists.xenproject.org, stefano.stabellini@citrix.com, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org Hi Ian, On 03/20/2014 01:23 PM, Ian Jackson wrote: > Julien Grall writes ("[PATCH] tools/libxl: Correctly check if libxl_get_scheduler has failed"): >> libxl_get_scheduler will return an enum, therefore checking if the value >> is negative is wrong. > > Gah. enums in C are so hateful. > >> - if ((sched = libxl_get_scheduler(ctx)) < 0) { >> + if ((int)(sched = libxl_get_scheduler(ctx)) < 0) { > > I'm afraid this isn't the right fix. The right fix is not to use the > enum type at all. libxl_get_scheduler, and the "sched" local, should > be ints. Thanks. I will rework the patch. Regards, -- Julien Grall