2
* Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003
3
* Inferno Nettverk A/S, Norway. All rights reserved.
5
* Redistribution and use in source and binary forms, with or without
6
* modification, are permitted provided that the following conditions
8
* 1. The above copyright notice, this list of conditions and the following
9
* disclaimer must appear in all copies of the software, derivative works
10
* or modified versions, and any portions thereof, aswell as in all
11
* supporting documentation.
12
* 2. All advertising materials mentioning features or use of this software
13
* must display the following acknowledgement:
14
* This product includes software developed by
15
* Inferno Nettverk A/S, Norway.
16
* 3. The name of the author may not be used to endorse or promote products
17
* derived from this software without specific prior written permission.
19
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
* Inferno Nettverk A/S requests users of this software to return to
32
* Software Distribution Coordinator or sdc@inet.no
33
* Inferno Nettverk A/S
39
* any improvements or extensions that they make and grant Inferno Nettverk A/S
40
* the rights to redistribute these changes.
46
static const char rcsid[] =
47
"$Id: serr.c,v 1.7 2003/07/01 13:21:31 michaels Exp $";
51
serr(int eval, const char *fmt, ...)
53
serr(eval, fmt, va_alist)
57
#endif /* STDC_HEADERS */
66
/* LINTED pointer casts may be troublesome */
70
#endif /* STDC_HEADERS */
72
bufused = vsnprintf(buf, sizeof(buf), fmt, ap);
74
bufused += snprintfn(&buf[bufused], sizeof(buf) - bufused,
75
": %s (errno = %d)", strerror(errno), errno);
77
slog(LOG_ERR, "%s", buf);
79
/* LINTED expression has null effect */
92
serrx(int eval, const char *fmt, ...)
94
serrx(eval, fmt, va_alist)
98
#endif /* STDC_HEADERS */
105
/* LINTED pointer casts may be troublesome */
109
#endif /* STDC_HEADERS */
110
vslog(LOG_ERR, fmt, ap);
112
/* LINTED expression has null effect */
125
swarn(const char *fmt, ...)
130
#endif /* STDC_HEADERS */
139
/* LINTED pointer casts may be troublesome */
143
#endif /* STDC_HEADERS */
145
bufused = vsnprintf(buf, sizeof(buf), fmt, ap);
147
bufused += snprintfn(&buf[bufused], sizeof(buf) - bufused,
148
": %s (errno = %d)", strerror(errno), errno);
150
slog(LOG_ERR, "%s", buf);
152
/* LINTED expression has null effect */
159
swarnx(const char *fmt, ...)
161
swarnx(fmt, va_alist)
164
#endif /* STDC_HEADERS */
171
/* LINTED pointer casts may be troublesome */
175
#endif /* STDC_HEADERS */
177
vslog(LOG_ERR, fmt, ap);
179
/* LINTED expression has null effect */