ia64/xen-unstable

changeset 7011:52eb8504be71

This fixes the "make check" feature of xenstore to properly compile with
x86-64. When compiling you would get the following error since on x86-64
it was passing a long , when you are expecting an int.

Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Sep 22 11:04:30 2005 +0100 (2005-09-22)
parents a32ee93b3b33
children 8dbcf407a680 11cca45a9a79
files tools/xenstore/xs_random.c
line diff
     1.1 --- a/tools/xenstore/xs_random.c	Wed Sep 21 23:41:34 2005 +0100
     1.2 +++ b/tools/xenstore/xs_random.c	Thu Sep 22 11:04:30 2005 +0100
     1.3 @@ -74,9 +74,9 @@ static void convert_to_dir(const char *d
     1.4  static void maybe_convert_to_directory(const char *filename)
     1.5  {
     1.6  	struct stat st;
     1.7 -	char *dirname = talloc_asprintf(filename, "%.*s", 
     1.8 -					strrchr(filename, '/') - filename,
     1.9 -					filename);
    1.10 +	char *dirname = talloc_asprintf(
    1.11 +		filename, "%.*s",
    1.12 +		(int)(strrchr(filename, '/') - filename), filename);
    1.13  	if (lstat(dirname, &st) == 0 && S_ISREG(st.st_mode))
    1.14  		convert_to_dir(dirname);
    1.15  }
    1.16 @@ -249,7 +249,7 @@ static void init_perms(const char *filen
    1.17  
    1.18  	/* Copy permissions from parent */
    1.19  	command = talloc_asprintf(filename, "cp %.*s/.perms %s",
    1.20 -				  strrchr(filename, '/') - filename,
    1.21 +				  (int)(strrchr(filename, '/') - filename),
    1.22  				  filename, permfile);
    1.23  	do_command(command);
    1.24  }	
    1.25 @@ -308,7 +308,7 @@ static char *parent_filename(const char 
    1.26  	char *slash = strrchr(name + 1, '/');
    1.27  	if (!slash)
    1.28  		return talloc_strdup(name, "/");
    1.29 -	return talloc_asprintf(name, "%.*s", slash-name, name);
    1.30 +	return talloc_asprintf(name, "%.*s", (int)(slash-name), name);
    1.31  }
    1.32  
    1.33  static void make_dirs(const char *filename)
    1.34 @@ -1063,7 +1063,8 @@ static unsigned int try_simple(const boo
    1.35  
    1.36  		ret = do_next_op(data->ops, h, i + data->seed, verbose);
    1.37  		if (verbose)
    1.38 -			printf("-> %.*s\n", strchr(ret, '\n') - ret, ret);
    1.39 +			printf("-> %.*s\n",
    1.40 +			       (int)(strchr(ret, '\n') - ret), ret);
    1.41  		if (streq(ret, "FAILED:Bad file descriptor"))
    1.42  			goto out;
    1.43  		if (kill(daemon_pid, 0) != 0)
    1.44 @@ -1334,13 +1335,14 @@ static unsigned int try_diff(const bool 
    1.45  
    1.46  		file = do_next_op(&file_ops, fileh, i+data->seed, verbose);
    1.47  		if (verbose)
    1.48 -			printf("-> %.*s\n", strchr(file, '/') - file, file);
    1.49 +			printf("-> %.*s\n",
    1.50 +			       (int)(strchr(file, '/') - file), file);
    1.51  		
    1.52  		if (verbose)
    1.53  			printf("XS: ");
    1.54  		xs = do_next_op(&xs_ops, xsh, i+data->seed, verbose);
    1.55  		if (verbose)
    1.56 -			printf("-> %.*s\n", strchr(xs, '/') - xs, xs);
    1.57 +			printf("-> %.*s\n", (int)(strchr(xs, '/') - xs), xs);
    1.58  
    1.59  		if (!streq(file, xs))
    1.60  			goto out;
    1.61 @@ -1508,7 +1510,8 @@ static unsigned int try_fail(const bool 
    1.62  			aborted++;
    1.63  
    1.64  		if (verbose)
    1.65 -			printf("-> %.*s\n", strchr(ret, '\n') - ret, ret);
    1.66 +			printf("-> %.*s\n",
    1.67 +			       (int)(strchr(ret, '\n') - ret), ret);
    1.68  
    1.69  		talloc_free(ret);
    1.70