1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 07:59:00 +00:00

util: remove virStrerror

Now that we use g_strerror exclusively, remove this unused
function.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Ján Tomko 2020-03-09 21:01:51 +01:00
parent b0eea635b3
commit 2245496d1c
3 changed files with 0 additions and 28 deletions

View File

@ -1981,7 +1981,6 @@ virReportOOMErrorFull;
virReportSystemErrorFull;
virSetError;
virSetErrorLogPriorityFunc;
virStrerror;
# util/vireventglib.h

View File

@ -1307,31 +1307,6 @@ void virReportErrorHelper(int domcode,
errno = save_errno;
}
/**
* virStrerror:
* @theerrno: the errno value
* @errBuf: the buffer to save the error to
* @errBufLen: the buffer length
*
* Generate an error string for the given errno
*
* Returns a pointer to the error string, possibly indicating that the
* error is unknown
*/
const char *virStrerror(int theerrno, char *errBuf, size_t errBufLen)
{
int save_errno = errno;
const char *ret;
const char *str = g_strerror(theerrno);
size_t len = strlen(str);
memcpy(errBuf, str, MIN(len, errBufLen));
errBuf[errBufLen-1] = '\0';
ret = errBuf;
errno = save_errno;
return ret;
}
/**
* virReportSystemErrorFull:
* @domcode: the virErrorDomain indicating where it's coming from

View File

@ -192,8 +192,6 @@ void virReportOOMErrorFull(int domcode,
int virSetError(virErrorPtr newerr);
virErrorPtr virErrorCopyNew(virErrorPtr err);
void virDispatchError(virConnectPtr conn);
/* DEPRECATED: use g_strerror() directly */
const char *virStrerror(int theerrno, char *errBuf, size_t errBufLen);
typedef int (*virErrorLogPriorityFunc)(virErrorPtr, int);
void virSetErrorLogPriorityFunc(virErrorLogPriorityFunc func);