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:
parent
7e0cd26db4
commit
c88ce8ae74
@ -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));
|
||||
|
@ -24,6 +24,8 @@
|
||||
|
||||
# include "internal.h"
|
||||
|
||||
# define VIR_ERROR_MAX_LENGTH 1024
|
||||
|
||||
extern virErrorFunc virErrorHandler;
|
||||
extern void *virUserData;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user