blob: a7dd986790a4972172ae5403e7709b2bf874dc84 [file] [log] [blame]
Matt Kraaic55b8d42001-05-16 15:40:51 +00001/* vi: set sw=4 ts=4: */
2/*
3 * Utility routines.
4 *
Eric Andersenc7bda1c2004-03-15 08:29:22 +00005 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
Matt Kraaic55b8d42001-05-16 15:40:51 +00006 *
Denys Vlasenko0ef64bd2010-08-16 20:14:46 +02007 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
Matt Kraaic55b8d42001-05-16 15:40:51 +00008 */
Matt Kraaic55b8d42001-05-16 15:40:51 +00009#include "libbb.h"
10
Denis Vlasenkodefc1ea2008-06-27 02:52:20 +000011void FAST_FUNC bb_herror_msg(const char *s, ...)
Matt Kraaic55b8d42001-05-16 15:40:51 +000012{
13 va_list p;
14
15 va_start(p, s);
Denis Vlasenkoab9c44b2007-08-15 20:07:53 +000016 bb_verror_msg(s, p, hstrerror(h_errno));
Matt Kraaic55b8d42001-05-16 15:40:51 +000017 va_end(p);
18}
Denys Vlasenko7e1bb4b2010-07-04 17:16:44 +020019
20void FAST_FUNC bb_herror_msg_and_die(const char *s, ...)
21{
22 va_list p;
23
24 va_start(p, s);
25 bb_verror_msg(s, p, hstrerror(h_errno));
26 va_end(p);
27 xfunc_die();
28}
James Byrne69374872019-07-02 11:35:03 +020029
30void FAST_FUNC bb_simple_herror_msg(const char *s)
31{
32 bb_herror_msg("%s", s);
33}
34
35void FAST_FUNC bb_simple_herror_msg_and_die(const char *s)
36{
37 bb_herror_msg_and_die("%s", s);
38}