X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb%2F_info;h=a20ef98af72c8320eda7d6693bd2320598939d67;hp=c2e5266b05f2b038276ebb021734f05d41d824a3;hb=74257cee33ae3033f961d5f22a0313b8cb1b18d4;hpb=d117f992bde6b7157a8eecbce8a026f2aa7ab4ae diff --git a/ccan/tdb/_info b/ccan/tdb/_info index c2e5266b..a20ef98a 100644 --- a/ccan/tdb/_info +++ b/ccan/tdb/_info @@ -14,10 +14,10 @@ * #include * #include * - * static void usage(void) + * static void usage(const char *argv0) * { * errx(1, "Usage: %s fetch \n" - * "OR %s store "); + * "OR %s store ", argv0, argv0); * } * * int main(int argc, char *argv[]) @@ -26,7 +26,7 @@ * TDB_DATA key, value; * * if (argc < 4) - * usage(); + * usage(argv[0]); * * tdb = tdb_open(argv[2], 1024, TDB_DEFAULT, O_CREAT|O_RDWR, * 0600); @@ -38,7 +38,7 @@ * * if (streq(argv[1], "fetch")) { * if (argc != 4) - * usage(); + * usage(argv[0]); * value = tdb_fetch(tdb, key); * if (!value.dptr) * errx(1, "fetch %s: %s", @@ -47,14 +47,14 @@ * free(value.dptr); * } else if (streq(argv[1], "store")) { * if (argc != 5) - * usage(); + * usage(argv[0]); * value.dptr = (void *)argv[4]; * value.dsize = strlen(argv[4]); * if (tdb_store(tdb, key, value, 0) != 0) * errx(1, "store %s: %s", * argv[3], tdb_errorstr(tdb)); * } else - * usage(); + * usage(argv[0]); * * return 0; * } @@ -63,9 +63,11 @@ * * Author: Andrew Tridgell, Jeremy Allison, Rusty Russell * - * Licence: LGPLv3 (or later) + * License: LGPL (v3 or any later version) * - * Fails: valgrind-tests // valgrind breaks fcntl locks. + * Ccanlint: + * // valgrind breaks fcntl locks. + * tests_pass_valgrind FAIL */ int main(int argc, char *argv[]) { @@ -73,6 +75,7 @@ int main(int argc, char *argv[]) return 1; if (strcmp(argv[1], "depends") == 0) { + printf("ccan/compiler\n"); return 0; }