aboutsummaryrefslogtreecommitdiffstats
path: root/src/zerror.c
blob: c59b092ef7b342362505c2ddc30a7e8d11635c9b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* See LICENSE file for copyright and license details. */
#include "internals.h"


enum zerror
zerror(const char **desc)
{
	if (libzahl_error >= 0) {
		if (desc)
			*desc = strerror(libzahl_error);
		errno = libzahl_error;
		return ZERROR_ERRNO_SET;
	} else {
		/* Current, we should not be able to get here. */
		if (desc)
			abort();
		return -libzahl_error;
	}
}