* Sherlock Library -- Bucket Manipulation Tool
*
* (c) 2001 Martin Mares <mj@ucw.cz>
+ *
+ * This software may be freely distributed and used according to the terms
+ * of the GNU Lesser General Public License.
*/
#include "lib/lib.h"
-c\t\tconcatenate and dump all buckets\n\
-f\t\taudit bucket file structure\n\
-F\t\taudit and fix bucket file structure\n\
+-q\t\tquick check of bucket file consistency\n\
-s\t\tshake down bucket file (without updating other structures!!!)\n\
-v\t\tbe verbose\n\
");
struct obuck_header h;
byte *e;
- in = bfdopen(0, 4096);
+ in = bfdopen_shared(0, 4096);
obuck_init(1);
do
{
}
while (e);
obuck_cleanup();
- /* bclose(in) not done, we don't want fd 0 closed */
+ bclose(in);
}
static void
obuck_cleanup();
}
+static void
+quickcheck(void)
+{
+ obuck_init(1);
+ obuck_cleanup();
+}
+
int
main(int argc, char **argv)
{
log_init(NULL);
op = 0;
- while ((i = cf_getopt(argc, argv, CF_SHORT_OPTS "lLd:x:icfFsv", CF_NO_LONG_OPTS, NULL)) != -1)
+ while ((i = cf_getopt(argc, argv, CF_SHORT_OPTS "lLd:x:icfFqsv", CF_NO_LONG_OPTS, NULL)) != -1)
if (i == '?' || op)
help();
else if (i == 'v')
case 'F':
fsck(1);
break;
+ case 'q':
+ quickcheck();
+ break;
case 's':
shake();
break;