]> Zhao Yanbai Git Server - minix.git/commitdiff
libchardriver: fix open reply for async devices
authorThomas Veerman <thomas@minix3.org>
Thu, 9 Feb 2012 10:32:08 +0000 (10:32 +0000)
committerThomas Veerman <thomas@minix3.org>
Thu, 9 Feb 2012 14:17:54 +0000 (14:17 +0000)
lib/libchardriver/chardriver.c
servers/avfs/device.c
servers/vfs/main.c

index 7f6256a340bf0a9114aa299fa97458fcd04942a3..2d0517a782d9aaadd90750721160922c25ccd577 100644 (file)
@@ -133,7 +133,7 @@ PRIVATE void async_reply(message *mess, int r)
 
   switch (mess->m_type) {
   case DEV_OPEN:
-       reply_mess.m_type = DEV_REVIVE;
+       reply_mess.m_type = DEV_OPEN_REPL;
        reply_mess.REP_ENDPT = mess->USER_ENDPT;
        reply_mess.REP_STATUS = r;
        break;
index 969ac8b7df83e8b776ef9dbb0848b1d417b69fe3..e6e019978d538cb221342a7908a945ab8c7ab63f 100644 (file)
@@ -545,6 +545,11 @@ PUBLIC int gen_opcl(
   r = (*dp->dmap_io)(dp->dmap_driver, &dev_mess);
   if (r != OK) return(r);
 
+  if (op == DEV_OPEN && dp->dmap_style == STYLE_DEVA) {
+       fp->fp_task = dp->dmap_driver;
+       worker_wait(dp->dmap_driver);
+  }
+
   if (is_bdev)
        return(dev_mess.BDEV_STATUS);
   else
index 34165898a0e8b23954b393adfbca2391c4673eb0..c9bd692e34f9d0861ca94f02bb9d3fa0c9a7d9d1 100644 (file)
@@ -66,6 +66,9 @@ PUBLIC int main(void)
        SANITYCHECK;
        get_work();             /* sets who and call_nr */
 
+       if (call_nr == DEV_OPEN_REPL)   /* XXX: hack to make DEV_OPEN_REPL */
+               call_nr = DEV_REVIVE;   /* work on synchronous VFS */
+
        if (call_nr == DEV_REVIVE)
        {
                endpoint_t endpt;