From 063d4ead61ee47433793de81a1c77e0ba69e6e07 Mon Sep 17 00:00:00 2001 From: "Kaleb S. KEITHLEY" Date: Fri, 16 Oct 2015 13:52:28 -0400 Subject: 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 Reviewed-on: http://review.gluster.org/12379 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy --- xlators/mgmt/glusterd/src/glusterd-handshake.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-handshake.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-handshake.c b/xlators/mgmt/glusterd/src/glusterd-handshake.c index 7e3955465a4..e3f949aed0b 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handshake.c +++ b/xlators/mgmt/glusterd/src/glusterd-handshake.c @@ -11,6 +11,7 @@ #include "xlator.h" #include "defaults.h" #include "glusterfs.h" +#include "syscall.h" #include "compat-errno.h" #include "glusterd.h" @@ -306,7 +307,7 @@ gotvolinfo: if (ret == -1) goto out; - ret = stat (path, &stbuf); + ret = sys_stat (path, &stbuf); if ((ret == -1) && (errno == ENOENT)) { strncpy (dup_volid, volid_ptr, (PATH_MAX - 1)); @@ -330,7 +331,7 @@ gotvolinfo: path_prefix, volinfo->volname, (trusted_str ? trusted_str : ""), dup_volid); - ret = stat (path, &stbuf); + ret = sys_stat (path, &stbuf); } out: if (dup_volname) @@ -798,7 +799,7 @@ __server_getspec (rpcsvc_request_t *req) if (ret == 0) { /* to allocate the proper buffer to hold the file data */ - ret = stat (filename, &stbuf); + ret = sys_stat (filename, &stbuf); if (ret < 0){ gf_msg ("glusterd", GF_LOG_ERROR, errno, GD_MSG_FILE_OP_FAILED, @@ -828,7 +829,7 @@ __server_getspec (rpcsvc_request_t *req) op_errno = ENOMEM; goto fail; } - ret = read (spec_fd, rsp.spec, file_len); + ret = sys_read (spec_fd, rsp.spec, file_len); } if (brick_name) { @@ -847,7 +848,7 @@ __server_getspec (rpcsvc_request_t *req) /* convert to XDR */ fail: if (spec_fd > 0) - close (spec_fd); + sys_close (spec_fd); rsp.op_ret = ret; -- cgit