From 489752596b7ed69efea2dadbcc21ec5afdc658f2 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sun, 26 Mar 2017 11:49:05 -0700 Subject: [PATCH] SLIRP: Coverity identified warning --- slirp_glue/glib_qemu_stubs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/slirp_glue/glib_qemu_stubs.c b/slirp_glue/glib_qemu_stubs.c index fd6030c8..a36bd4b5 100644 --- a/slirp_glue/glib_qemu_stubs.c +++ b/slirp_glue/glib_qemu_stubs.c @@ -151,8 +151,10 @@ unsigned long non_block = 1; void qemu_set_nonblock(int fd) { int f; + f = fcntl(fd, F_GETFL); - fcntl(fd, F_SETFL, f | O_NONBLOCK); + if (f!= -1) + fcntl(fd, F_SETFL, f | O_NONBLOCK); } #endif