Signed-off-by: Daniel Henrique Barboza <danielhb413(a)gmail.com>
---
src/logging/log_handler.c | 7 ++-----
src/logging/log_manager.c | 14 ++++----------
2 files changed, 6 insertions(+), 15 deletions(-)
diff --git a/src/logging/log_handler.c b/src/logging/log_handler.c
index 29ea3011b9..030c9d66e3 100644
--- a/src/logging/log_handler.c
+++ b/src/logging/log_handler.c
@@ -196,10 +196,10 @@ virLogHandlerNew(bool privileged,
virLogHandlerPtr handler;
if (virLogHandlerInitialize() < 0)
- goto error;
+ return NULL;
if (!(handler = virObjectLockableNew(virLogHandlerClass)))
- goto error;
+ return NULL;
handler->privileged = privileged;
handler->max_size = max_size;
@@ -208,9 +208,6 @@ virLogHandlerNew(bool privileged,
handler->opaque = opaque;
return handler;
-
- error:
- return NULL;
}
diff --git a/src/logging/log_manager.c b/src/logging/log_manager.c
index 6b66218116..fd7c2922b3 100644
--- a/src/logging/log_manager.c
+++ b/src/logging/log_manager.c
@@ -213,7 +213,6 @@ virLogManagerDomainGetLogFilePosition(virLogManagerPtr mgr,
{
struct virLogManagerProtocolDomainGetLogFilePositionArgs args;
struct virLogManagerProtocolDomainGetLogFilePositionRet ret;
- int rv = -1;
memset(&args, 0, sizeof(args));
memset(&ret, 0, sizeof(ret));
@@ -228,14 +227,12 @@ virLogManagerDomainGetLogFilePosition(virLogManagerPtr mgr,
0, NULL, NULL, NULL,
(xdrproc_t)xdr_virLogManagerProtocolDomainGetLogFilePositionArgs, &args,
(xdrproc_t)xdr_virLogManagerProtocolDomainGetLogFilePositionRet, &ret) < 0)
- goto cleanup;
+ return -1;
*inode = ret.pos.inode;
*offset = ret.pos.offset;
- rv = 0;
- cleanup:
- return rv;
+ return 0;
}
@@ -249,7 +246,6 @@ virLogManagerDomainReadLogFile(virLogManagerPtr mgr,
{
struct virLogManagerProtocolDomainReadLogFileArgs args;
struct virLogManagerProtocolDomainReadLogFileRet ret;
- char *rv = NULL;
memset(&args, 0, sizeof(args));
memset(&ret, 0, sizeof(ret));
@@ -267,11 +263,9 @@ virLogManagerDomainReadLogFile(virLogManagerPtr mgr,
0, NULL, NULL, NULL,
(xdrproc_t)xdr_virLogManagerProtocolDomainReadLogFileArgs, &args,
(xdrproc_t)xdr_virLogManagerProtocolDomainReadLogFileRet,
&ret) < 0)
- goto cleanup;
+ return NULL;
- rv = ret.data;
- cleanup:
- return rv;
+ return ret.data;
}
--
2.24.1