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