summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-system.c
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2015-05-18 16:26:02 +0200
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-05-29 05:43:17 -0700
commit8a9328e37b8c63d60583184dc8dab12f85810682 (patch)
tree0fa017379bf5e9dfaa2e6d8132c73cc1090a3d52 /cli/src/cli-cmd-system.c
parent5d912230a7d4f9979c10ff15da724624bd8e069d (diff)
build: do not #include "config.h" in each file
Instead of including config.h in each file, and have the additional config.h included from the compiler commandline (-include option). When a .c file tests for a certain #define, and config.h was not included, incorrect assumtions were made. With this change, it can not happen again. BUG: 1222319 Change-Id: I4f9097b8740b81ecfe8b218d52ca50361f74cb64 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/10808 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'cli/src/cli-cmd-system.c')
-rw-r--r--cli/src/cli-cmd-system.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/cli/src/cli-cmd-system.c b/cli/src/cli-cmd-system.c
index 690a104183a..d71f622ba11 100644
--- a/cli/src/cli-cmd-system.c
+++ b/cli/src/cli-cmd-system.c
@@ -13,11 +13,6 @@
#include <stdint.h>
#include <pthread.h>
-#ifndef _CONFIG_H
-#define _CONFIG_H
-#include "config.h"
-#endif
-
#include "cli.h"
#include "cli-cmd.h"
#include "cli-mem-types.h"
'>- struct saved_frame *saved_frame = NULL;
-
- conn = &rpc_clnt->conn;
-
- saved_frame = __saved_frames_put(conn->saved_frames, frame, rpcreq);
+ struct saved_frame *saved_frame = __saved_frames_put(conn->saved_frames,
+ frame, rpcreq);
if (saved_frame == NULL) {
goto out;
@@ -1678,18 +1675,18 @@ rpc_clnt_submit(struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, int procnum,
{
if (conn->connected == 0) {
if (rpc->disabled)
- goto nosubmit;
+ goto unlock;
ret = rpc_transport_connect(conn->trans, conn->config.remote_port);
if (ret < 0) {
gf_log(conn->name, GF_LOG_WARNING,
"error returned while attempting to "
"connect to host:%s, port:%d",
conn->config.remote_host, conn->config.remote_port);
+ goto unlock;
}
}
ret = rpc_transport_submit_request(conn->trans, &req);
- nosubmit:
if (ret == -1) {
gf_log(conn->name, GF_LOG_WARNING,
"failed to submit rpc-request "
@@ -1698,9 +1695,7 @@ rpc_clnt_submit(struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, int procnum,
"ProgVers: %d, Proc: %d) to rpc-transport (%s)",
cframe->root->unique, rpcreq->xid, rpcreq->prog->progname,
rpcreq->prog->progver, rpcreq->procnum, conn->name);
- }
-
- if ((ret >= 0) && frame) {
+ } else if ((ret >= 0) && frame) {
/* Save the frame in queue */
__save_frame(rpc, frame, rpcreq);
@@ -1722,6 +1717,7 @@ rpc_clnt_submit(struct rpc_clnt *rpc, rpc_clnt_prog_t *prog, int procnum,
rpcreq->prog->progver, rpcreq->procnum, conn->name);
}
}
+unlock:
pthread_mutex_unlock(&conn->lock);
if (need_unref)