[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 25/29] libvchan: check for fcntl failures in select-type sample application



Coverity-ID: 1055041
Signed-off-by: Matthew Daley <mattjd@xxxxxxxxx>
---
 tools/libvchan/node-select.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/libvchan/node-select.c b/tools/libvchan/node-select.c
index 6c6c19e..c6914ab 100644
--- a/tools/libvchan/node-select.c
+++ b/tools/libvchan/node-select.c
@@ -105,8 +105,10 @@ int main(int argc, char **argv)
                exit(1);
        }
 
-       fcntl(0, F_SETFL, O_NONBLOCK);
-       fcntl(1, F_SETFL, O_NONBLOCK);
+       if (fcntl(0, F_SETFL, O_NONBLOCK) == -1 || fcntl(1, F_SETFL, 
O_NONBLOCK) == -1) {
+               perror("fcntl");
+               exit(1);
+       }
 
        libxenvchan_fd = libxenvchan_fd_for_select(ctrl);
        for (;;) {
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.