summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-rpc-ops.c
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2015-10-01 16:31:19 -0400
committerJeff Darcy <jdarcy@redhat.com>2015-10-28 13:38:42 -0700
commit3066a21caafab6305527991de11c8eb43ec0044c (patch)
tree5efc91272ac76ff1613cee1e8a41aeb32aa92d73 /cli/src/cli-rpc-ops.c
parent063d4ead61ee47433793de81a1c77e0ba69e6e07 (diff)
core: use syscall wrappers instead of direct syscalls - miscellaneous
various xlators and other components are invoking system calls directly instead of using the libglusterfs/syscall.[ch] wrappers. If not using the system call wrappers there should be a comment in the source explaining why the wrapper isn't used. Change-Id: I1f47820534c890a00b452fa61f7438eb2b3f667c BUG: 1267967 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/12276 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'cli/src/cli-rpc-ops.c')
-rw-r--r--cli/src/cli-rpc-ops.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 553a94a219a..562c176a2f9 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -5280,7 +5280,7 @@ write_contents_to_common_pem_file (dict_t *dict, int output_count)
"%s/geo-replication/common_secret.pem.pub",
workdir);
- unlink (common_pem_file);
+ sys_unlink (common_pem_file);
fd = open (common_pem_file, O_WRONLY | O_CREAT, 0600);
if (fd == -1) {
@@ -5302,7 +5302,7 @@ write_contents_to_common_pem_file (dict_t *dict, int output_count)
cli_out ("Unable to fetch output.");
}
if (output) {
- bytes_written = write (fd, output, strlen(output));
+ bytes_written = sys_write (fd, output, strlen(output));
if (bytes_written != strlen(output)) {
gf_log ("", GF_LOG_ERROR, "Failed to write "
"to %s", common_pem_file);
@@ -5310,7 +5310,7 @@ write_contents_to_common_pem_file (dict_t *dict, int output_count)
goto out;
}
/* Adding the new line character */
- bytes_written = write (fd, "\n", strlen("\n"));
+ bytes_written = sys_write (fd, "\n", strlen("\n"));
if (bytes_written != strlen("\n")) {
gf_log ("", GF_LOG_ERROR,
"Failed to add new line char");
@@ -5325,7 +5325,7 @@ write_contents_to_common_pem_file (dict_t *dict, int output_count)
ret = 0;
out:
if (fd >= 0)
- close (fd);
+ sys_close (fd);
gf_log ("", GF_LOG_DEBUG, "Returning %d", ret);
return ret;
@@ -10488,7 +10488,7 @@ gf_cli_get_vol_opt_cbk (struct rpc_req *req, struct iovec *iov, int count,
cli_out ("%-40s%-40s", "Option", "Value");
cli_out ("%-40s%-40s", "------", "-----");
for (i=1; i<=count; i++) {
- sprintf (dict_key, "key%d", i);
+ snprintf (dict_key, sizeof dict_key, "key%d", i);
ret = dict_get_str (dict, dict_key, &key);
if (ret) {
gf_log ("cli", GF_LOG_ERROR, "Failed to"
@@ -10496,7 +10496,7 @@ gf_cli_get_vol_opt_cbk (struct rpc_req *req, struct iovec *iov, int count,
"dictionary", dict_key);
goto out;
}
- sprintf (dict_key, "value%d", i);
+ snprintf (dict_key, sizeof dict_key, "value%d", i);
ret = dict_get_str (dict, dict_key, &value);
if (ret) {
gf_log ("cli", GF_LOG_ERROR, "Failed to "