CID:124 NEGATIVE_RETURNS - Possible use of negative file descriptor.
authorNelson Ferreira <nelson.ferreira@ieee.org>
Sun, 18 Sep 2011 06:37:01 +0000 (02:37 -0400)
committerNelson Ferreira <nelson.ferreira@ieee.org>
Sun, 18 Sep 2011 06:37:01 +0000 (02:37 -0400)
    * src/ui/X11/event-Xt.c(emacs_Xt_unselect_console): Only call
    unselect_filedesc if the descriptor is valid

src/ui/X11/event-Xt.c

index fd8fad1..d70662d 100644 (file)
@@ -2604,7 +2604,8 @@ emacs_Xt_unselect_console(struct console *con)
        }
        infd = event_stream_unixoid_unselect_console(con);
        XSETCONSOLE(console, con);
-       unselect_filedesc(infd);
+       if (infd >= 0)
+               unselect_filedesc(infd);
        return;
 }