]>
Commit | Line | Data |
---|---|---|
07800601 | 1 | /* |
5f9273d6 NK |
2 | * usage.c |
3 | * | |
4 | * Various reporting routines. | |
5 | * Originally copied from GIT source. | |
07800601 IM |
6 | * |
7 | * Copyright (C) Linus Torvalds, 2005 | |
8 | */ | |
9 | #include "util.h" | |
0d37aa34 | 10 | #include "debug.h" |
07800601 | 11 | |
6c346643 | 12 | static __noreturn void usage_builtin(const char *err) |
07800601 | 13 | { |
716c69fe | 14 | fprintf(stderr, "\n Usage: %s\n", err); |
07800601 IM |
15 | exit(129); |
16 | } | |
17 | ||
07800601 IM |
18 | /* If we are in a dlopen()ed .so write to a global variable would segfault |
19 | * (ugh), so keep things static. */ | |
6c346643 | 20 | static void (*usage_routine)(const char *err) __noreturn = usage_builtin; |
2690c730 | 21 | |
07800601 IM |
22 | void usage(const char *err) |
23 | { | |
24 | usage_routine(err); | |
25 | } |