X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Frwv.c;h=1bcca57f27104fb71214f10b75295f2654d22ce7;hb=0585b0fb5895a24f07ca32e830d1fa72b75f4f2b;hp=7bf4d73f1fe711003e595342c3d7dc6e40544d1d;hpb=e3a7c58aebafce40323db54bf6056029e5af4a70;p=fs%2Flustre-release.git diff --git a/lustre/tests/rwv.c b/lustre/tests/rwv.c index 7bf4d73..1bcca57 100644 --- a/lustre/tests/rwv.c +++ b/lustre/tests/rwv.c @@ -24,7 +24,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Whamcloud, Inc. + * Copyright (c) 2012, 2014 Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -43,12 +43,7 @@ #include #include -#include -#include -#include -#include -#include -#include +#include #define ACT_NONE 0 #define ACT_READ 1 @@ -179,13 +174,15 @@ int main(int argc, char** argv) iv->iov_len = strtoul(argv[optind++], &end, 0); if (*end) { printf("Error iov size\n"); - GOTO(out, rc = 1); + rc = 1; + goto out; } iv->iov_base = mmap(NULL, iv->iov_len, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, 0, 0); if (iv->iov_base == MAP_FAILED) { printf("No memory %s\n", strerror(errno)); - GOTO(out, rc = 1); + rc = 1; + goto out; } if (act & ACT_WRITE) memset(iv->iov_base, pad, iv->iov_len); @@ -200,7 +197,8 @@ int main(int argc, char** argv) if ((act & ACT_SEEK) && (lseek64(fd, offset, SEEK_SET) < 0)) { printf("Cannot seek %s\n", strerror(errno)); - GOTO(out, rc == 1); + rc = 1; + goto out; } if (act & ACT_WRITE) { @@ -208,19 +206,23 @@ int main(int argc, char** argv) if (rc != len) { printf("Write error: %s (rc = %d, len = %ld)\n", strerror(errno), rc, len); - GOTO(out, rc = 1); + rc = 1; + goto out; } } else if (act & ACT_READ) { rc = readv(fd, iov, iovcnt); if (rc != len) { printf("Read error: %s rc = %d\n", strerror(errno), rc); - GOTO(out, rc = 1); + rc = 1; + goto out; } /* It should return zeroed buf if the read hits hole.*/ if (((act & ACT_READHOLE) || (act & ACT_VERIFY)) && - data_verify(iov, iovcnt, pad)) - GOTO(out, rc = 1); + data_verify(iov, iovcnt, pad)) { + rc = 1; + goto out; + } } rc = 0;