mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
tevent:testsuite: fix O3 errors unused result for read
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org>
This commit is contained in:
parent
1521e688b6
commit
22918a033b
@ -38,6 +38,15 @@
|
|||||||
|
|
||||||
static int fde_count;
|
static int fde_count;
|
||||||
|
|
||||||
|
static void do_read(int fd, void *buf, size_t count)
|
||||||
|
{
|
||||||
|
ssize_t ret;
|
||||||
|
|
||||||
|
do {
|
||||||
|
ret = read(fd, buf, count);
|
||||||
|
} while (ret == -1 && errno == EINTR);
|
||||||
|
}
|
||||||
|
|
||||||
static void fde_handler_read(struct tevent_context *ev_ctx, struct tevent_fd *f,
|
static void fde_handler_read(struct tevent_context *ev_ctx, struct tevent_fd *f,
|
||||||
uint16_t flags, void *private_data)
|
uint16_t flags, void *private_data)
|
||||||
{
|
{
|
||||||
@ -48,7 +57,7 @@ static void fde_handler_read(struct tevent_context *ev_ctx, struct tevent_fd *f,
|
|||||||
#endif
|
#endif
|
||||||
kill(getpid(), SIGALRM);
|
kill(getpid(), SIGALRM);
|
||||||
|
|
||||||
read(fd[0], &c, 1);
|
do_read(fd[0], &c, 1);
|
||||||
fde_count++;
|
fde_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +81,7 @@ static void fde_handler_read_1(struct tevent_context *ev_ctx, struct tevent_fd *
|
|||||||
#endif
|
#endif
|
||||||
kill(getpid(), SIGALRM);
|
kill(getpid(), SIGALRM);
|
||||||
|
|
||||||
read(fd[1], &c, 1);
|
do_read(fd[1], &c, 1);
|
||||||
fde_count++;
|
fde_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user