summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-02-08 17:33:59 +0100
committerVolker Lendecke <vlendec@samba.org>2011-02-28 16:40:19 +0100
commit884984ae0a9b551dcd92d6d0486b2d741eabd20f (patch)
tree5cd5348b260f0c385c283bfddb6211e6cafef8a1 /source3/lib
parent83becbe369bcf3478063662fc2626ccbf4530b20 (diff)
downloadsamba-884984ae0a9b551dcd92d6d0486b2d741eabd20f.tar.gz
samba-884984ae0a9b551dcd92d6d0486b2d741eabd20f.tar.bz2
samba-884984ae0a9b551dcd92d6d0486b2d741eabd20f.zip
s3: Add poll_intr_one_fd
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_sock.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 3dd84fe8d7..51de68f4c3 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -1793,3 +1793,20 @@ int poll_one_fd(int fd, int events, int timeout, int *revents)
return ret;
}
+
+int poll_intr_one_fd(int fd, int events, int timeout, int *revents)
+{
+ struct pollfd pfd;
+ int ret;
+
+ pfd.fd = fd;
+ pfd.events = events;
+
+ ret = sys_poll_intr(&pfd, 1, timeout);
+ if (ret <= 0) {
+ *revents = 0;
+ return ret;
+ }
+ *revents = pfd.revents;
+ return 1;
+}