diff options
author | Kaleb S. KEITHLEY <kkeithle@redhat.com> | 2015-10-01 16:28:58 -0400 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2015-11-16 06:18:10 -0800 |
commit | 2099cc875a4d20ab1bb12b1c33da16c95968e202 (patch) | |
tree | 78b611ee025511a06f28e8d5e63453f1dc5d8f1d /libglusterfs/src/event-poll.c | |
parent | 3f0c70f2d56743707699f6a5b62a1c2c2d5c6f85 (diff) |
core: use syscall wrappers instead of direct syscalls - libglusterfs
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: Ieeca2d36adbc884e4cfa0026dba40df70310d40b
BUG: 1267967
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/12275
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'libglusterfs/src/event-poll.c')
-rw-r--r-- | libglusterfs/src/event-poll.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/libglusterfs/src/event-poll.c b/libglusterfs/src/event-poll.c index 51c0cf1f4e7..2006e33d33b 100644 --- a/libglusterfs/src/event-poll.c +++ b/libglusterfs/src/event-poll.c @@ -20,6 +20,7 @@ #include "event.h" #include "mem-pool.h" #include "common-utils.h" +#include "syscall.h" #include "libglusterfs-messages.h" @@ -49,7 +50,7 @@ __flush_fd (int fd, int idx, void *data, return ret; do { - ret = read (fd, buf, 64); + ret = sys_read (fd, buf, 64); if (ret == -1 && errno != EAGAIN) { gf_msg ("poll", GF_LOG_ERROR, errno, LG_MSG_FILE_OP_FAILED, "read on %d returned " @@ -128,8 +129,8 @@ event_pool_new_poll (int count, int eventthreadcount) if (ret == -1) { gf_msg ("poll", GF_LOG_ERROR, errno, LG_MSG_SET_PIPE_FAILED, "could not set pipe to non blocking mode"); - close (event_pool->breaker[0]); - close (event_pool->breaker[1]); + sys_close (event_pool->breaker[0]); + sys_close (event_pool->breaker[1]); event_pool->breaker[0] = event_pool->breaker[1] = -1; GF_FREE (event_pool->reg); @@ -142,8 +143,8 @@ event_pool_new_poll (int count, int eventthreadcount) gf_msg ("poll", GF_LOG_ERROR, errno, LG_MSG_SET_PIPE_FAILED, "could not set pipe to non blocking mode"); - close (event_pool->breaker[0]); - close (event_pool->breaker[1]); + sys_close (event_pool->breaker[0]); + sys_close (event_pool->breaker[1]); event_pool->breaker[0] = event_pool->breaker[1] = -1; GF_FREE (event_pool->reg); @@ -156,8 +157,8 @@ event_pool_new_poll (int count, int eventthreadcount) if (ret == -1) { gf_msg ("poll", GF_LOG_ERROR, 0, LG_MSG_REGISTER_PIPE_FAILED, "could not register pipe fd with poll event loop"); - close (event_pool->breaker[0]); - close (event_pool->breaker[1]); + sys_close (event_pool->breaker[0]); + sys_close (event_pool->breaker[1]); event_pool->breaker[0] = event_pool->breaker[1] = -1; GF_FREE (event_pool->reg); @@ -288,7 +289,7 @@ event_unregister_close_poll (struct event_pool *event_pool, int fd, ret = event_unregister_poll (event_pool, fd, idx_hint); - close (fd); + sys_close (fd); return ret; } @@ -506,11 +507,11 @@ event_pool_destroy_poll (struct event_pool *event_pool) { int ret = 0; - ret = close (event_pool->breaker[0]); + ret = sys_close (event_pool->breaker[0]); if (ret) return ret; - ret = close (event_pool->breaker[1]); + ret = sys_close (event_pool->breaker[1]); if (ret) return ret; |