X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ferr%2F_info;h=2af206633e935c9ca956a40cd5bc43e470c71a75;hb=54f85c236ad6f04734cda522ffb78bce7be824bf;hp=5a5752bb0b297418486200661ec69db71d84dbdf;hpb=4776faf17adfa16ef5b2aeb24414b9d73a5789fc;p=ccan diff --git a/ccan/err/_info b/ccan/err/_info index 5a5752bb..2af20663 100644 --- a/ccan/err/_info +++ b/ccan/err/_info @@ -1,6 +1,6 @@ +#include "config.h" #include #include -#include "config.h" /** * err - err(), errx(), warn() and warnx(), as per BSD's err.h. @@ -8,17 +8,21 @@ * A few platforms don't provide err.h; for those, this provides replacements. * For most, it simple includes the system err.h. * + * Unfortunately, you have to call err_set_progname() to tell the replacements + * your program name, otherwise it prints "unknown program". + * * Example: * #include * * int main(int argc, char *argv[]) * { + * err_set_progname(argv[0]); * if (argc != 1) * errx(1, "Expect no arguments"); * exit(0); * } * - * License: Public domain + * License: CC0 (Public domain) * Author: Rusty Russell */ int main(int argc, char *argv[])