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.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.c')
| -rw-r--r-- | libglusterfs/src/event.c | 9 | 
1 files changed, 5 insertions, 4 deletions
diff --git a/libglusterfs/src/event.c b/libglusterfs/src/event.c index aeef67107f5..09ecce1599d 100644 --- a/libglusterfs/src/event.c +++ b/libglusterfs/src/event.c @@ -21,6 +21,7 @@  #include "mem-pool.h"  #include "common-utils.h"  #include "libglusterfs-messages.h" +#include "syscall.h" @@ -177,7 +178,7 @@ poller_destroy_handler (int fd, int idx, void *data,          if (readfd < 0)                  return -1; -        while (read (readfd, &buf, 1) > 0) { +        while (sys_read (readfd, &buf, 1) > 0) {          }          return 0;  } @@ -254,7 +255,7 @@ event_dispatch_destroy (struct event_pool *event_pool)                  int retry = 0;                  while (event_pool->activethreadcount > 0 && retry++ < 10) { -                        if (write (fd[1], "dummy", 6) == -1) +                        if (sys_write (fd[1], "dummy", 6) == -1)                                  break;                          sleep_till.tv_sec = time (NULL) + 1;                          ret = pthread_cond_timedwait (&event_pool->cond, @@ -268,9 +269,9 @@ event_dispatch_destroy (struct event_pool *event_pool)   out:          if (fd[0] != -1) -                close (fd[0]); +                sys_close (fd[0]);          if (fd[1] != -1) -                close (fd[1]); +                sys_close (fd[1]);          return ret;  }  | 
