From 7fc6f3eb40cbce8b4d5a611ea5090738d5b0589f Mon Sep 17 00:00:00 2001 From: Andrew Perepechko Date: Thu, 24 Dec 2009 17:45:35 +0300 Subject: [PATCH] b=21670 getopt fixes in tests/mpi i=Brian Murrell getopt returns int, at the same time "char" type can have the same range as "unsigned char" type and, thus, unable to hold -1 rc from getopt --- lustre/tests/mpi/cascading_rw.c | 3 +-- lustre/tests/mpi/mdsrate.c | 4 ++-- lustre/tests/mpi/write_disjoint.c | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lustre/tests/mpi/cascading_rw.c b/lustre/tests/mpi/cascading_rw.c index f23d0a8..e9f00aa 100644 --- a/lustre/tests/mpi/cascading_rw.c +++ b/lustre/tests/mpi/cascading_rw.c @@ -317,8 +317,7 @@ void usage(char *proc) int main(int argc, char *argv[]) { - int i, iterations = 16; - char c; + int i, iterations = 16, c; long stride = -1; unsigned int seed = 0; diff --git a/lustre/tests/mpi/mdsrate.c b/lustre/tests/mpi/mdsrate.c index 44e0b79..fc10732 100644 --- a/lustre/tests/mpi/mdsrate.c +++ b/lustre/tests/mpi/mdsrate.c @@ -243,8 +243,8 @@ int llapi_file_lookup(int dirfd, const char *name) static void process_args(int argc, char *argv[]) { - char c, *cp, *endptr; - int i, index, offset, tmpend, rc; + char *cp, *endptr; + int i, index, offset, tmpend, rc, c; char tmp[16]; FILE * seed_file; struct option *opt; diff --git a/lustre/tests/mpi/write_disjoint.c b/lustre/tests/mpi/write_disjoint.c index 9b28d60..2561000 100644 --- a/lustre/tests/mpi/write_disjoint.c +++ b/lustre/tests/mpi/write_disjoint.c @@ -77,13 +77,13 @@ void rprintf(int rank, int loop, const char *fmt, ...) #define CHUNK_SIZE(n) chunk_size[(n) % 2] int main (int argc, char *argv[]) { - int i, n, fd; + int i, n, fd, c; unsigned long chunk_size[2]; int rank, noProcessors, done; int error; off_t offset; char **chunk_buf; - char *read_buf, c; + char *read_buf; struct stat stat_buf; ssize_t ret; char *filename = "/mnt/lustre/write_disjoint"; -- 1.8.3.1