wilde: utils/admin validate-skiplist.c,1.1,1.2
cvs at intevation.de
cvs at intevation.de
Sun Mar 26 11:17:15 CEST 2006
Author: wilde
Update of /kolabrepository/utils/admin
In directory doto:/tmp/cvs-serv16424
Modified Files:
validate-skiplist.c
Log Message:
Added support for checking of multiple files.
Index: validate-skiplist.c
===================================================================
RCS file: /kolabrepository/utils/admin/validate-skiplist.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- validate-skiplist.c 26 Mar 2006 00:24:38 -0000 1.1
+++ validate-skiplist.c 26 Mar 2006 09:17:13 -0000 1.2
@@ -6,6 +6,7 @@
This program is free software under the GNU GPL (>=v2)
Read the file COPYING coming with the software for details.
-------------------------------------------------------------------
+ $Id$
This little tool does a simple syntactic evaluation on cyrus
skiplist database files.
@@ -51,8 +52,8 @@
void
print_usage ()
{
- puts ("Usage: validate-skiplist [OPTIONS] [FILE]");
- puts ("Validate cyrus skiplist FILE.\n");
+ puts ("Usage: validate-skiplist [OPTIONS] [FILE] ...");
+ puts ("Validate cyrus skiplist FILEs.\n");
puts (" -w print out non fatal warnings");
puts (" -v be verbose");
@@ -113,7 +114,7 @@
++delete;
break;
default:
- errx (1, "Bad node: expected ADD or DELETE at 0x%X! (found %i)",
+ errx (1, "Bad node: expected ADD or DELETE at 0x%X! (found 0x%X)",
ftell (file), word);
}
commit_maybe (file);
@@ -165,9 +166,9 @@
{
ungetc (c, file);
add_delete (file);
- }
+ }
- INFO (printf ("Found %i ADD, %i DELETE and %i COMMIT nodes in log.\n",
+ INFO (printf ("Found %i ADD, %i DELETE and %i COMMIT nodes in log.\n\n",
add, delete, commit);
);
@@ -178,7 +179,7 @@
int
main (int argc, char** argv)
{
- int c;
+ int c, i;
while ((c = getopt (argc, argv, "hvw")) != -1)
switch (c)
@@ -196,8 +197,9 @@
exit (1);
}
- if (optind == (argc - 1))
- validate_file (argv[optind]);
+ if (argc > optind)
+ for (i = optind; i < argc; i++)
+ validate_file (argv[i]);
else
errx (1, "Missing filename.");
More information about the commits
mailing list