summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/logging.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/libglusterfs/src/logging.c b/libglusterfs/src/logging.c
index a0f501ec739..431ae979cba 100644
--- a/libglusterfs/src/logging.c
+++ b/libglusterfs/src/logging.c
@@ -1940,20 +1940,11 @@ _gf_msg(const char *domain, const char *file, const char *function,
int ret = 0;
char *msgstr = NULL;
va_list ap;
- xlator_t *this = NULL;
+ xlator_t *this = THIS;
glusterfs_ctx_t *ctx = NULL;
char *callstr = NULL;
int log_inited = 0;
- /* in args check */
- if (!domain || !file || !function || !fmt) {
- fprintf(stderr, "logging: %s:%s():%d: invalid argument\n", __FILE__,
- __PRETTY_FUNCTION__, __LINE__);
- return -1;
- }
-
- this = THIS;
-
if (this == NULL)
return -1;
@@ -1967,6 +1958,13 @@ _gf_msg(const char *domain, const char *file, const char *function,
if (skip_logging(this, level))
goto out;
+ /* in args check */
+ if (!domain || !file || !function || !fmt) {
+ fprintf(stderr, "logging: %s:%s():%d: invalid argument\n", __FILE__,
+ __PRETTY_FUNCTION__, __LINE__);
+ return -1;
+ }
+
/* form the message */
va_start(ap, fmt);
ret = vasprintf(&msgstr, fmt, ap);