X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fcheckstat.c;h=efc3afcc03d8121a2be736162b87617ad4375384;hp=f09fde9430d75f42b479f2c0a943d9a64078d250;hb=5a6aa0e6d1583cc0d4c82ae8c95fb7b9856d6284;hpb=26969941d8be6bef2ce1d48ddf8cb3432343192a diff --git a/lustre/tests/checkstat.c b/lustre/tests/checkstat.c index f09fde9..efc3afc 100644 --- a/lustre/tests/checkstat.c +++ b/lustre/tests/checkstat.c @@ -1,3 +1,40 @@ +/* + * GPL HEADER START + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 for more details (a copy is included + * in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU General Public License + * version 2 along with this program; If not, see + * http://www.gnu.org/licenses/gpl-2.0.html + * + * GPL HEADER END + */ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Use is subject to license terms. + * + * Copyright (c) 2011, Intel Corporation. + */ +/* + * Test program to compare the attributes of a files to verify that it + * desired file attributes are present. This file predates availability + * of the stat(3) utility and is deprecated. Either test(3) ([ ]) or + * stat(3) should be used in all new tests. + * + * This file is part of Lustre, http://www.lustre.org/ + * Lustre is a trademark of Sun Microsystems, Inc. + */ + #include #include #include @@ -215,7 +252,8 @@ main (int argc, char **argv) } else { - fprintf (stderr, "Can't parse file type %s\n", type); + fprintf (stderr, "Can't parse file type %s\n", + type); return (1); } @@ -229,7 +267,8 @@ main (int argc, char **argv) { if (verbose) printf ("%s has perms 0%o, not 0%o\n", - fname, (buf.st_mode & ~S_IFMT), perms); + fname, (buf.st_mode & ~S_IFMT), + perms); return (1); } @@ -238,19 +277,18 @@ main (int argc, char **argv) fname, perms); } - if (size != -1) - { - if (buf.st_size != size) - { - if (verbose) - printf ("%s has size %Ld, not %Ld\n", - fname, (long long)buf.st_size, size); - return (1); - } - - if (verbose) - printf ("%s has size %Ld OK\n", fname, size); - } + if (size != -1) { + if (buf.st_size != size) { + if (verbose) + printf("%s has size %lld, not %lld\n", + fname, (long long)buf.st_size, + size); + return 1; + } + + if (verbose) + printf("%s has size %lld OK\n", fname, size); + } if (checklink != NULL) {