From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: [PATCH 06/17] xenpaging: do not use DPRINTF/ERROR if xch handle is unavailable Date: Mon, 06 Dec 2010 21:59:13 +0100 Message-ID: <20101206205910.174101794@aepfle.de> References: <20101206205907.848643876@aepfle.de> Return-path: Content-Disposition: inline; filename=xen-unstable.xenpaging.xc_handle.dprintf.patch List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Fix DPRINTF/ERROR usage. Both macros reference a xch variable in local scope. If xc_interface_open fails and after xc_interface_close, both can not be used anymore. Use standard fprintf for this case. Remove the code to print the exit value, its not really useful. Its a left-over for debugging from an earlier patch. Signed-off-by: Olaf Hering --- tools/xenpaging/xenpaging.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- xen-unstable.hg-4.1.22459.orig/tools/xenpaging/xenpaging.c +++ xen-unstable.hg-4.1.22459/tools/xenpaging/xenpaging.c @@ -539,7 +539,7 @@ int main(int argc, char *argv[]) paging = xenpaging_init(&xch, domain_id); if ( paging == NULL ) { - ERROR("Error initialising paging"); + fprintf(stderr, "Error initialising paging"); return 1; } @@ -688,12 +688,10 @@ int main(int argc, char *argv[]) /* Tear down domain paging */ rc1 = xenpaging_teardown(xch, paging); if ( rc1 != 0 ) - ERROR("Error tearing down paging"); + fprintf(stderr, "Error tearing down paging"); if ( rc == 0 ) rc = rc1; - - DPRINTF("xenpaging exit code %d\n", rc); return rc; }