xref: /freebsd/lib/libkvm/tests/kvm_test_common.c (revision 10f81a9b3b6549ff94936ab526d9155bd9384c98)
1*10f81a9bSEnji Cooper /*-
2*10f81a9bSEnji Cooper  * Copyright (c) 2017 Ngie Cooper <ngie@freebsd.org>
3*10f81a9bSEnji Cooper  * All rights reserved.
4*10f81a9bSEnji Cooper  *
5*10f81a9bSEnji Cooper  * Redistribution and use in source and binary forms, with or without
6*10f81a9bSEnji Cooper  * modification, are permitted provided that the following conditions
7*10f81a9bSEnji Cooper  * are met:
8*10f81a9bSEnji Cooper  * 1. Redistributions of source code must retain the above copyright
9*10f81a9bSEnji Cooper  *    notice, this list of conditions and the following disclaimer.
10*10f81a9bSEnji Cooper  * 2. Redistributions in binary form must reproduce the above copyright
11*10f81a9bSEnji Cooper  *    notice, this list of conditions and the following disclaimer in the
12*10f81a9bSEnji Cooper  *    documentation and/or other materials provided with the distribution.
13*10f81a9bSEnji Cooper  *
14*10f81a9bSEnji Cooper  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15*10f81a9bSEnji Cooper  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16*10f81a9bSEnji Cooper  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17*10f81a9bSEnji Cooper  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18*10f81a9bSEnji Cooper  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19*10f81a9bSEnji Cooper  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20*10f81a9bSEnji Cooper  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21*10f81a9bSEnji Cooper  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22*10f81a9bSEnji Cooper  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23*10f81a9bSEnji Cooper  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24*10f81a9bSEnji Cooper  * SUCH DAMAGE.
25*10f81a9bSEnji Cooper  */
26*10f81a9bSEnji Cooper 
27*10f81a9bSEnji Cooper #include <sys/cdefs.h>
28*10f81a9bSEnji Cooper __FBSDID("$FreeBSD$");
29*10f81a9bSEnji Cooper 
30*10f81a9bSEnji Cooper #include <sys/types.h>
31*10f81a9bSEnji Cooper #include <string.h>
32*10f81a9bSEnji Cooper 
33*10f81a9bSEnji Cooper #include "kvm_test_common.h"
34*10f81a9bSEnji Cooper 
35*10f81a9bSEnji Cooper char	errbuf[_POSIX2_LINE_MAX];
36*10f81a9bSEnji Cooper 
37*10f81a9bSEnji Cooper void
38*10f81a9bSEnji Cooper errbuf_clear(void)
39*10f81a9bSEnji Cooper {
40*10f81a9bSEnji Cooper 
41*10f81a9bSEnji Cooper 	strcpy(errbuf, "");
42*10f81a9bSEnji Cooper }
43*10f81a9bSEnji Cooper 
44*10f81a9bSEnji Cooper bool
45*10f81a9bSEnji Cooper errbuf_has_error(const char *_errbuf)
46*10f81a9bSEnji Cooper {
47*10f81a9bSEnji Cooper 
48*10f81a9bSEnji Cooper 	return (strcmp(_errbuf, ""));
49*10f81a9bSEnji Cooper }
50