X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=libbb%2Fperror_msg.c;h=fa1f0d3398f087b7cde0b4c56dffa06e6e65b678;hb=cfbd31a7fb0a2e76864432823da1aa956fbdfa25;hp=a958cff006587b28419c73667e91f6e62a59f819;hpb=ab9c44b1a41c9a17cd0f8a8f1e5517756ccb8bf0;p=oweals%2Fbusybox.git diff --git a/libbb/perror_msg.c b/libbb/perror_msg.c index a958cff00..fa1f0d339 100644 --- a/libbb/perror_msg.c +++ b/libbb/perror_msg.c @@ -4,12 +4,21 @@ * * 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 "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; @@ -17,4 +26,15 @@ void bb_perror_msg(const char *s, ...) /* 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); }