From: Ian Jackson Subject: Re: [PATCH] tools/libxl: Correctly check if libxl_get_scheduler has failed Date: Thu, 20 Mar 2014 13:23:09 +0000 Message-ID: <21290.60349.509788.373481@mariner.uk.xensource.com> References: <1395272536-5157-1-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WQcwD-0003Cy-Pc for xen-devel@lists.xenproject.org; Thu, 20 Mar 2014 13:23:13 +0000 In-Reply-To: <1395272536-5157-1-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: xen-devel@lists.xenproject.org, stefano.stabellini@citrix.com, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org 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. Ian.