]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: remove virStrerror
authorJán Tomko <jtomko@redhat.com>
Mon, 9 Mar 2020 20:01:51 +0000 (21:01 +0100)
committerJán Tomko <jtomko@redhat.com>
Fri, 13 Mar 2020 16:26:55 +0000 (17:26 +0100)
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>
src/libvirt_private.syms
src/util/virerror.c
src/util/virerror.h

index 68481a10d8ea1b38c654ac4569be19ec86b11624..c140164cddd70568df61301551e1cd5d3948e76d 100644 (file)
@@ -1981,7 +1981,6 @@ virReportOOMErrorFull;
 virReportSystemErrorFull;
 virSetError;
 virSetErrorLogPriorityFunc;
-virStrerror;
 
 
 # util/vireventglib.h
index 16c384d2f9f48059bb8d34fc012631ea5a7e9f51..774c36bca3a0dfc3cde5fae872bf98201065149e 100644 (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
index 2e27655b72d75bbfd4c44a31adc72ec07a135376..9d3e40d65a815f02f4dae9253b3411ade631dede 100644 (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);