Whamcloud - gitweb
b=21670 getopt fixes in tests/mpi
authorAndrew Perepechko <andrew.perepechko@sun.com>
Thu, 24 Dec 2009 14:45:35 +0000 (17:45 +0300)
committerAndrew Perepechko <andrew.perepechko@sun.com>
Thu, 24 Dec 2009 14:45:35 +0000 (17:45 +0300)
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
lustre/tests/mpi/mdsrate.c
lustre/tests/mpi/write_disjoint.c

index f23d0a8..e9f00aa 100644 (file)
@@ -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;
 
index 44e0b79..fc10732 100644 (file)
@@ -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;
index 9b28d60..2561000 100644 (file)
@@ -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";