diff options
author | Kaleb S. KEITHLEY <kkeithle@redhat.com> | 2015-10-16 13:52:28 -0400 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2015-10-28 06:55:04 -0700 |
commit | 063d4ead61ee47433793de81a1c77e0ba69e6e07 (patch) | |
tree | 484f5fe3093d7eec12a282f77e2df496afff6ee2 /xlators/mgmt/glusterd/src/glusterd-mountbroker.c | |
parent | 641b3a9164227db52df1aab05795c90d06b315f2 (diff) |
core: use syscall wrappers instead of direct syscalls -- glusterd
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: I28bf2a5f7730b35914e7ab57fed91e1966b30073
BUG: 1267967
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/12379
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-mountbroker.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-mountbroker.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-mountbroker.c b/xlators/mgmt/glusterd/src/glusterd-mountbroker.c index 4ed2fb7035d..3125612d2cf 100644 --- a/xlators/mgmt/glusterd/src/glusterd-mountbroker.c +++ b/xlators/mgmt/glusterd/src/glusterd-mountbroker.c @@ -17,6 +17,7 @@ #include "dict.h" #include "list.h" #include "logging.h" +#include "syscall.h" #include "defaults.h" #include "compat.h" #include "compat-errno.h" @@ -587,16 +588,16 @@ glusterd_do_mount (char *label, dict_t *argdict, char **path, int *op_errno) sla = strrchr (mtptemp, '/'); *sla = '\0'; - ret = mkdir (mtptemp, 0700); + ret = sys_mkdir (mtptemp, 0700); if (ret == 0) - ret = chown (mtptemp, uid, 0); + ret = sys_chown (mtptemp, uid, 0); else if (errno == EEXIST) ret = 0; if (ret == -1) { *op_errno = errno; goto out; } - ret = lstat (mtptemp, &st); + ret = sys_lstat (mtptemp, &st); if (ret == -1) { *op_errno = errno; goto out; @@ -628,7 +629,7 @@ glusterd_do_mount (char *label, dict_t *argdict, char **path, int *op_errno) *op_errno = errno; goto out; } - close (ret); + sys_close (ret); /*** assembly the path from cookie to mountpoint */ sla = strchr (sla - 1, '/'); @@ -642,9 +643,9 @@ glusterd_do_mount (char *label, dict_t *argdict, char **path, int *op_errno) /*** create cookie link in (to-be) mountpoint, move it over to the final place */ *cookieswitch = '/'; - ret = symlink (mntlink, mtptemp); + ret = sys_symlink (mntlink, mtptemp); if (ret != -1) - ret = rename (mtptemp, cookie); + ret = sys_rename (mtptemp, cookie); *cookieswitch = '\0'; if (ret == -1) { *op_errno = errno; @@ -674,12 +675,12 @@ glusterd_do_mount (char *label, dict_t *argdict, char **path, int *op_errno) strerror (*op_errno)); if (mtptemp) { *cookieswitch = '/'; - unlink (mtptemp); + sys_unlink (mtptemp); *cookieswitch = '\0'; - rmdir (mtptemp); + sys_rmdir (mtptemp); } if (cookie) { - unlink (cookie); + sys_unlink (cookie); GF_FREE (cookie); } |