1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

vierror: Define VIR_ERROR_MAX_LENGTH macro

And use it instead of a magic 1024 constant.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Jiri Denemark 2017-11-22 10:28:35 +01:00
parent 7e0cd26db4
commit c88ce8ae74
2 changed files with 5 additions and 3 deletions

View File

@ -1480,7 +1480,7 @@ void virReportErrorHelper(int domcode,
{
int save_errno = errno;
va_list args;
char errorMessage[1024];
char errorMessage[VIR_ERROR_MAX_LENGTH];
const char *virerr;
if (fmt) {
@ -1541,8 +1541,8 @@ void virReportSystemErrorFull(int domcode,
const char *fmt, ...)
{
int save_errno = errno;
char strerror_buf[1024];
char msgDetailBuf[1024];
char strerror_buf[VIR_ERROR_MAX_LENGTH];
char msgDetailBuf[VIR_ERROR_MAX_LENGTH];
const char *errnoDetail = virStrerror(theerrno, strerror_buf,
sizeof(strerror_buf));

View File

@ -24,6 +24,8 @@
# include "internal.h"
# define VIR_ERROR_MAX_LENGTH 1024
extern virErrorFunc virErrorHandler;
extern void *virUserData;