X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=libbb%2Fperror_msg.c;h=fa1f0d3398f087b7cde0b4c56dffa06e6e65b678;hb=cfbd31a7fb0a2e76864432823da1aa956fbdfa25;hp=7fb0830be35d80d41948193c44d3493e2132fc69;hpb=b1629b1b2abc17a6430e4173d64d7956784118e0;p=oweals%2Fbusybox.git diff --git a/libbb/perror_msg.c b/libbb/perror_msg.c index 7fb0830be..fa1f0d339 100644 --- a/libbb/perror_msg.c +++ b/libbb/perror_msg.c @@ -4,20 +4,37 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - -#include -#include -#include -#include #include "libbb.h" -void bb_perror_msg(const char *s, ...) +void FAST_FUNC bb_perror_msg(const char *s, ...) +{ + va_list p; + + va_start(p, s); + /* Guard against ": Success" */ + bb_verror_msg(s, p, errno ? strerror(errno) : NULL); + va_end(p); +} + +void FAST_FUNC bb_perror_msg_and_die(const char *s, ...) { va_list p; va_start(p, s); - bb_vperror_msg(s, p); + /* Guard against ": Success" */ + bb_verror_msg(s, p, errno ? strerror(errno) : NULL); va_end(p); + xfunc_die(); +} + +void FAST_FUNC bb_simple_perror_msg(const char *s) +{ + bb_perror_msg("%s", s); +} + +void FAST_FUNC bb_simple_perror_msg_and_die(const char *s) +{ + bb_perror_msg_and_die("%s", s); }