direct-io.hg

changeset 6425:28ffa7296a44

Bugfix: xenstat_collect_networks now returns the correct error code.
Signed-off-by: Josh Triplett <josht@us.ibm.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Fri Aug 26 08:49:31 2005 +0000 (2005-08-26)
parents 9404574350ce
children a032aca565a3
files tools/xenstat/libxenstat/src/xenstat.c
line diff
     1.1 --- a/tools/xenstat/libxenstat/src/xenstat.c	Fri Aug 26 08:48:59 2005 +0000
     1.2 +++ b/tools/xenstat/libxenstat/src/xenstat.c	Fri Aug 26 08:49:31 2005 +0000
     1.3 @@ -493,20 +493,20 @@ static int xenstat_collect_networks(xens
     1.4  		node->handle->procnetdev = fopen("/proc/net/dev", "r");
     1.5  		if (node->handle->procnetdev == NULL) {
     1.6  			perror("Error opening /proc/net/dev");
     1.7 -			return 1;
     1.8 +			return 0;
     1.9  		}
    1.10  
    1.11  		/* Validate the format of /proc/net/dev */
    1.12  		if (fread(header, sizeof(PROCNETDEV_HEADER) - 1, 1,
    1.13  			  node->handle->procnetdev) != 1) {
    1.14  			perror("Error reading /proc/net/dev header");
    1.15 -			return 1;
    1.16 +			return 0;
    1.17  		}
    1.18  		header[sizeof(PROCNETDEV_HEADER) - 1] = '\0';
    1.19  		if (strcmp(header, PROCNETDEV_HEADER) != 0) {
    1.20  			fprintf(stderr,
    1.21  				"Unexpected /proc/net/dev format\n");
    1.22 -			return 1;
    1.23 +			return 0;
    1.24  		}
    1.25  	}
    1.26  
    1.27 @@ -558,7 +558,7 @@ static int xenstat_collect_networks(xens
    1.28  				    sizeof(xenstat_network));
    1.29  		}
    1.30  		if (domain->networks == NULL)
    1.31 -			return 1;
    1.32 +			return 0;
    1.33  		domain->networks[domain->num_networks - 1] = net;
    1.34  	}
    1.35