diff options
author | Kaleb S. KEITHLEY <kkeithle@redhat.com> | 2015-10-01 16:31:19 -0400 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2015-10-28 13:38:42 -0700 |
commit | 3066a21caafab6305527991de11c8eb43ec0044c (patch) | |
tree | 5efc91272ac76ff1613cee1e8a41aeb32aa92d73 /xlators/protocol | |
parent | 063d4ead61ee47433793de81a1c77e0ba69e6e07 (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 'xlators/protocol')
-rw-r--r-- | xlators/protocol/server/src/server-handshake.c | 9 | ||||
-rw-r--r-- | xlators/protocol/server/src/server-helpers.c | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c index 62d9368e33a..293509c5d3f 100644 --- a/xlators/protocol/server/src/server-handshake.c +++ b/xlators/protocol/server/src/server-handshake.c @@ -17,6 +17,7 @@ #include "glusterfs3.h" #include "authenticate.h" #include "server-messages.h" +#include "syscall.h" struct __get_xl_struct { const char *name; @@ -208,7 +209,7 @@ _validate_volfile_checksum (xlator_t *this, char *key, } get_checksum_for_file (fd, &local_checksum); _volfile_update_checksum (this, key, local_checksum); - close (fd); + sys_close (fd); } temp_volfile = conf->volfile; @@ -267,7 +268,7 @@ server_getspec (rpcsvc_request_t *req) filename, sizeof (filename)); 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 (this->name, GF_LOG_ERROR, errno, PS_MSG_STAT_ERROR, "Unable to stat %s (%s)", @@ -302,7 +303,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); } /* convert to XDR */ @@ -314,7 +315,7 @@ fail: rsp.op_ret = ret; if (spec_fd != -1) - close (spec_fd); + sys_close (spec_fd); server_submit_reply (NULL, req, &rsp, NULL, 0, NULL, (xdrproc_t)xdr_gf_getspec_rsp); diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c index 0971e84298c..bcd1fed8b84 100644 --- a/xlators/protocol/server/src/server-helpers.c +++ b/xlators/protocol/server/src/server-helpers.c @@ -12,6 +12,7 @@ #include "server-helpers.h" #include "gidcache.h" #include "server-messages.h" +#include "syscall.h" #include <fnmatch.h> #include <pwd.h> @@ -556,7 +557,7 @@ server_build_config (xlator_t *this, server_conf_t *conf) if (data) { /* Check whether the specified directory exists, or directory specified is non standard */ - ret = stat (data->data, &buf); + ret = sys_stat (data->data, &buf); if ((ret != 0) || !S_ISDIR (buf.st_mode)) { gf_msg (this->name, GF_LOG_ERROR, 0, PS_MSG_DIR_NOT_FOUND, "Directory '%s' doesn't " |