diff options
author | Niels de Vos <ndevos@redhat.com> | 2015-01-19 11:17:20 +0100 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2015-01-20 12:39:39 -0800 |
commit | cdb3fa6088957ed257bfe2c3af59a80033cb2cbb (patch) | |
tree | 44aa912fde2b37cfb99f0a2174ed27923b8f581b | |
parent | 7510d8edf4e7bea50e0c1f041202f063a5d138af (diff) |
gfapi: allow transport=NULL for set_volfile_server()
Users of gfapi should not need to care about the supported transport
methods, this is an advanced option. Simple use-cases for libgfapi
should be able to pass NULL as transport, and the libraries should take
care of connecting to the Gluster server(s) correctly.
BUG: 1183547
Change-Id: Id93f96a3d10ae9fb69d53192642145ba8deed863
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/9464
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
-rw-r--r-- | api/src/glfs.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/api/src/glfs.c b/api/src/glfs.c index ee1e90d75b6..75dd315f6bd 100644 --- a/api/src/glfs.c +++ b/api/src/glfs.c @@ -375,7 +375,7 @@ pub_glfs_set_volfile_server (struct glfs *fs, const char *transport, server_cmdline_t *tmp = NULL; int ret = -1; - if (!transport || !host) { + if (!fs || !host) { errno = EINVAL; return ret; } @@ -400,10 +400,12 @@ pub_glfs_set_volfile_server (struct glfs *fs, const char *transport, goto out; } - server->transport = gf_strdup (transport); - if (!server->transport) { - errno = ENOMEM; - goto out; + if (transport) { + server->transport = gf_strdup (transport); + if (!server->transport) { + errno = ENOMEM; + goto out; + } } server->port = port; |