lib: Add tevent_req_poll_unix
authorVolker Lendecke <vl@samba.org>
Wed, 9 Jul 2014 12:50:24 +0000 (12:50 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 7 Jul 2015 21:51:23 +0000 (23:51 +0200)
This makes sync wrappers a bit shorter

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/util/tevent_unix.c
lib/util/tevent_unix.h

index ee7ec8a6fec89d382ade57a9292eae58e56419cb..63bdaf6916bbcd0a5612a429e7eb817da3d4765f 100644 (file)
@@ -61,3 +61,13 @@ int tevent_req_simple_recv_unix(struct tevent_req *req)
        tevent_req_received(req);
        return err;
 }
+
+bool tevent_req_poll_unix(struct tevent_req *req, struct tevent_context *ev,
+                         int *err)
+{
+       bool ret = tevent_req_poll(req, ev);
+       if (!ret) {
+               *err = errno;
+       }
+       return ret;
+}
index c1b0eb4e3ff8731313cda600652de4098963c745..39689d6117723ec1b116b6b65a1c9559793950ed 100644 (file)
@@ -28,5 +28,7 @@
 
 bool tevent_req_is_unix_error(struct tevent_req *req, int *perrno);
 int tevent_req_simple_recv_unix(struct tevent_req *req);
+bool tevent_req_poll_unix(struct tevent_req *req, struct tevent_context *ev,
+                         int *err);
 
 #endif