From 373b25827f0250d11461fbe76dd6a0e295069171 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Mon, 20 Aug 2012 10:48:16 -0700 Subject: core: enable process to return the appropriate error code Setup a pipe() in glusterfs_ctx_t to communicate with the fork'ed child the exit status and return it to the shell. Change-Id: Ibbaa581d45acb24d5141e43ae848cae29312d95f BUG: 762935 Signed-off-by: Anand Avati Reviewed-on: http://review.gluster.org/3836 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi --- libglusterfs/src/ctx.c | 3 +++ libglusterfs/src/glusterfs.h | 1 + 2 files changed, 4 insertions(+) (limited to 'libglusterfs') diff --git a/libglusterfs/src/ctx.c b/libglusterfs/src/ctx.c index 01489fbe0..0082601d4 100644 --- a/libglusterfs/src/ctx.c +++ b/libglusterfs/src/ctx.c @@ -34,6 +34,9 @@ glusterfs_ctx_new () INIT_LIST_HEAD (&ctx->graphs); INIT_LIST_HEAD (&ctx->mempool_list); + ctx->daemon_pipe[0] = -1; + ctx->daemon_pipe[1] = -1; + ret = pthread_mutex_init (&ctx->lock, NULL); if (ret) { free (ctx); diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h index 57bc7998f..b9c2b603e 100644 --- a/libglusterfs/src/glusterfs.h +++ b/libglusterfs/src/glusterfs.h @@ -393,6 +393,7 @@ struct _glusterfs_ctx { int mem_acct_enable; + int daemon_pipe[2]; }; typedef struct _glusterfs_ctx glusterfs_ctx_t; -- cgit