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

src/ui/X11/event-Xt.c

index 5719a4f..1fb2489 100644 (file)
@@ -2496,7 +2496,8 @@ emacs_Xt_select_process(Lisp_Process * p)
        int infd = event_stream_unixoid_select_process(p);
 
        XSETPROCESS(process, p);
-       select_filedesc(infd, process);
+       if (infd >= 0)
+               select_filedesc(infd, process);
        return;
 }