]> Zhao Yanbai Git Server - minix.git/commitdiff
don't suspend the process as a side-effect if
authorBen Gras <ben@minix3.org>
Fri, 8 May 2009 13:50:29 +0000 (13:50 +0000)
committerBen Gras <ben@minix3.org>
Fri, 8 May 2009 13:50:29 +0000 (13:50 +0000)
device returns SUSPEND if it's select; select already
does this.

servers/vfs/device.c

index 744db491bd610f32720b75324e7e33d3462d234d..a7a969153d2440a8f9b9d77367b520e611680bb5 100644 (file)
@@ -458,8 +458,11 @@ int suspend_reopen;                /* Just suspend the process */
                (*dp->dmap_io)(dp->dmap_driver, &dev_mess);
                if (dev_mess.REP_STATUS == EINTR) dev_mess.REP_STATUS = EAGAIN;
        } else {
-               /* Suspend user. */
-               suspend(dp->dmap_driver);
+               /* select() will do suspending itself. */
+               if(op != DEV_SELECT) {
+                       /* Suspend user. */
+                       suspend(dp->dmap_driver);
+               }
                assert(!GRANT_VALID(fp->fp_grant));
                fp->fp_grant = gid;     /* revoke this when unsuspended. */
                fp->fp_ioproc = ioproc;