summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/common-utils.h1
-rw-r--r--libglusterfs/src/graph.c11
-rw-r--r--libglusterfs/src/logging.c7
3 files changed, 13 insertions, 6 deletions
diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h
index d9d3082c0..b89a988c6 100644
--- a/libglusterfs/src/common-utils.h
+++ b/libglusterfs/src/common-utils.h
@@ -30,6 +30,7 @@
void trap (void);
#define GF_UNIVERSAL_ANSWER 42 /* :O */
+#define TMP_MAX 238328
/* To solve type punned error */
#define VOID(ptr) ((void **) ((void *) ptr))
diff --git a/libglusterfs/src/graph.c b/libglusterfs/src/graph.c
index 70b38dc50..8a84d4cbc 100644
--- a/libglusterfs/src/graph.c
+++ b/libglusterfs/src/graph.c
@@ -492,11 +492,14 @@ glusterfs_graph_activate (glusterfs_graph_t *graph, glusterfs_ctx_t *ctx)
ctx->active = graph;
/* XXX: attach to master and set active pointer */
- if (ctx->master)
+ if (ctx->master) {
ret = xlator_notify (ctx->master, GF_EVENT_GRAPH_NEW, graph);
- if (ret) {
- gf_log ("graph", GF_LOG_ERROR, "graph new notification failed");
- return ret;
+ if (ret) {
+ gf_log ("graph", GF_LOG_ERROR,
+ "graph new notification failed");
+ return ret;
+ }
+ ((xlator_t *)ctx->master)->next = graph->top;
}
/* XXX: perform parent up */
diff --git a/libglusterfs/src/logging.c b/libglusterfs/src/logging.c
index d8b9a124b..65613f985 100644
--- a/libglusterfs/src/logging.c
+++ b/libglusterfs/src/logging.c
@@ -598,6 +598,10 @@ _gf_log_eh (const char *function, const char *fmt, ...)
va_end (ap);
msg = GF_MALLOC (strlen (str1) + strlen (str2) + 1, gf_common_mt_char);
+ if (!msg) {
+ ret = -1;
+ goto out;
+ }
strcpy (msg, str1);
strcat (msg, str2);
@@ -605,8 +609,7 @@ _gf_log_eh (const char *function, const char *fmt, ...)
ret = eh_save_history (this->history, msg);
out:
- if (str1)
- GF_FREE (str1);
+ GF_FREE (str1);
/* Use FREE instead of GF_FREE since str2 was allocated by vasprintf */
if (str2)