At this point the ctdb socket is blocking, so we can save a syscall when
we wait indefinitely anyway.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Aug 6 18:01:54 CEST 2014 on sn-devel-104
timeout = -1;
}
- ret = poll_one_fd(fd, POLLIN, timeout, &revents);
- if (ret == -1) {
- return map_nt_error_from_unix(errno);
- }
- if (ret == 0) {
- return NT_STATUS_IO_TIMEOUT;
- }
- if (ret != 1) {
- return NT_STATUS_UNEXPECTED_IO_ERROR;
+ if (timeout != -1) {
+ ret = poll_one_fd(fd, POLLIN, timeout, &revents);
+ if (ret == -1) {
+ return map_nt_error_from_unix(errno);
+ }
+ if (ret == 0) {
+ return NT_STATUS_IO_TIMEOUT;
+ }
+ if (ret != 1) {
+ return NT_STATUS_UNEXPECTED_IO_ERROR;
+ }
}
status = read_data(fd, (char *)&msglen, sizeof(msglen));