diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-06-24 12:47:09 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-06-24 12:47:09 -0400 |
commit | f0df110ba42a6d23cb222069e4c2a4712d48d9f1 (patch) | |
tree | 6065cecd996ef7720aa8dfc942d5ec639bb91060 /src/diag.c | |
parent | 5c3572dc323527a5c168cc12a31b730e0749002d (diff) | |
download | bfs-f0df110ba42a6d23cb222069e4c2a4712d48d9f1.tar.xz |
bfstd: Add a getprogname() wrapper
Diffstat (limited to 'src/diag.c')
-rw-r--r-- | src/diag.c | 12 |
1 files changed, 1 insertions, 11 deletions
@@ -14,17 +14,7 @@ #include <string.h> noreturn void bfs_abortf(const struct bfs_loc *loc, const char *format, ...) { - const char *cmd = NULL; -#if __GLIBC__ - cmd = program_invocation_short_name; -#elif BSD - cmd = getprogname(); -#endif - if (!cmd) { - cmd = BFS_COMMAND; - } - - fprintf(stderr, "%s: %s@%s:%d: ", cmd, loc->func, loc->file, loc->line); + fprintf(stderr, "%s: %s@%s:%d: ", xgetprogname(), loc->func, loc->file, loc->line); va_list args; va_start(args, format); |