diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-09-22 11:04:30 +0100 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-09-22 11:04:30 +0100 |
commit | c50a971459cebd55833ef1d3a50c75c3c4c3975a (patch) | |
tree | d97c38f6faa7fecee07e49dc44340066bab5cb79 /tools/xenstore | |
parent | 6f06ab2fd112452f146f9cdd12ae38c4c05e9146 (diff) | |
download | xen-c50a971459cebd55833ef1d3a50c75c3c4c3975a.tar.gz xen-c50a971459cebd55833ef1d3a50c75c3c4c3975a.tar.bz2 xen-c50a971459cebd55833ef1d3a50c75c3c4c3975a.zip |
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>
Diffstat (limited to 'tools/xenstore')
-rw-r--r-- | tools/xenstore/xs_random.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/tools/xenstore/xs_random.c b/tools/xenstore/xs_random.c index 04a0411396..ebda938e37 100644 --- a/tools/xenstore/xs_random.c +++ b/tools/xenstore/xs_random.c @@ -74,9 +74,9 @@ static void convert_to_dir(const char *dirname) static void maybe_convert_to_directory(const char *filename) { struct stat st; - char *dirname = talloc_asprintf(filename, "%.*s", - strrchr(filename, '/') - filename, - filename); + char *dirname = talloc_asprintf( + filename, "%.*s", + (int)(strrchr(filename, '/') - filename), filename); if (lstat(dirname, &st) == 0 && S_ISREG(st.st_mode)) convert_to_dir(dirname); } @@ -249,7 +249,7 @@ static void init_perms(const char *filename) /* Copy permissions from parent */ command = talloc_asprintf(filename, "cp %.*s/.perms %s", - strrchr(filename, '/') - filename, + (int)(strrchr(filename, '/') - filename), filename, permfile); do_command(command); } @@ -308,7 +308,7 @@ static char *parent_filename(const char *name) char *slash = strrchr(name + 1, '/'); if (!slash) return talloc_strdup(name, "/"); - return talloc_asprintf(name, "%.*s", slash-name, name); + return talloc_asprintf(name, "%.*s", (int)(slash-name), name); } static void make_dirs(const char *filename) @@ -1063,7 +1063,8 @@ static unsigned int try_simple(const bool *trymap, ret = do_next_op(data->ops, h, i + data->seed, verbose); if (verbose) - printf("-> %.*s\n", strchr(ret, '\n') - ret, ret); + printf("-> %.*s\n", + (int)(strchr(ret, '\n') - ret), ret); if (streq(ret, "FAILED:Bad file descriptor")) goto out; if (kill(daemon_pid, 0) != 0) @@ -1334,13 +1335,14 @@ static unsigned int try_diff(const bool *trymap, file = do_next_op(&file_ops, fileh, i+data->seed, verbose); if (verbose) - printf("-> %.*s\n", strchr(file, '/') - file, file); + printf("-> %.*s\n", + (int)(strchr(file, '/') - file), file); if (verbose) printf("XS: "); xs = do_next_op(&xs_ops, xsh, i+data->seed, verbose); if (verbose) - printf("-> %.*s\n", strchr(xs, '/') - xs, xs); + printf("-> %.*s\n", (int)(strchr(xs, '/') - xs), xs); if (!streq(file, xs)) goto out; @@ -1508,7 +1510,8 @@ static unsigned int try_fail(const bool *trymap, aborted++; if (verbose) - printf("-> %.*s\n", strchr(ret, '\n') - ret, ret); + printf("-> %.*s\n", + (int)(strchr(ret, '\n') - ret), ret); talloc_free(ret); |