summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-volume.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-cmd-volume.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-cmd-volume.c')
-rw-r--r--cli/src/cli-cmd-volume.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index 73579a5581b..4cff9e9e7c0 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -1123,7 +1123,7 @@ gf_cli_create_auxiliary_mount (char *volname)
}
GLUSTERD_GET_QUOTA_AUX_MOUNT_PATH (mountdir, volname, "/");
- ret = mkdir (mountdir, 0777);
+ ret = sys_mkdir (mountdir, 0777);
if (ret && errno != EEXIST) {
gf_log ("cli", GF_LOG_ERROR, "Failed to create auxiliary mount "
"directory %s. Reason : %s", mountdir,
@@ -1253,9 +1253,10 @@ _limits_set_on_volume (char *volname, int type) {
/* TODO: fix hardcoding; Need to perform an RPC call to glusterd
* to fetch working directory
*/
- sprintf (quota_conf_file, "%s/vols/%s/quota.conf",
- GLUSTERD_DEFAULT_WORKDIR,
- volname);
+ snprintf (quota_conf_file, sizeof quota_conf_file,
+ "%s/vols/%s/quota.conf",
+ GLUSTERD_DEFAULT_WORKDIR,
+ volname);
fd = open (quota_conf_file, O_RDONLY);
if (fd == -1)
goto out;
@@ -1283,7 +1284,7 @@ _limits_set_on_volume (char *volname, int type) {
}
out:
if (fd != -1)
- close (fd);
+ sys_close (fd);
return limits_set;
}
@@ -1421,9 +1422,10 @@ cli_cmd_quota_handle_list_all (const char **words, dict_t *options)
//TODO: fix hardcoding; Need to perform an RPC call to glusterd
//to fetch working directory
- sprintf (quota_conf_file, "%s/vols/%s/quota.conf",
- GLUSTERD_DEFAULT_WORKDIR,
- volname);
+ snprintf (quota_conf_file, sizeof quota_conf_file,
+ "%s/vols/%s/quota.conf",
+ GLUSTERD_DEFAULT_WORKDIR,
+ volname);
fd = open (quota_conf_file, O_RDONLY);
if (fd == -1) {
//This may because no limits were yet set on the volume
@@ -1504,7 +1506,7 @@ out:
}
if (fd != -1) {
- close (fd);
+ sys_close (fd);
}
GF_FREE (gfid_str);