From 4498750810fd5e3098cc7db5e877c7765ab90e53 Mon Sep 17 00:00:00 2001 From: Thomas Veerman Date: Thu, 9 Feb 2012 10:32:08 +0000 Subject: [PATCH] libchardriver: fix open reply for async devices --- lib/libchardriver/chardriver.c | 2 +- servers/avfs/device.c | 5 +++++ servers/vfs/main.c | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/libchardriver/chardriver.c b/lib/libchardriver/chardriver.c index 7f6256a34..2d0517a78 100644 --- a/lib/libchardriver/chardriver.c +++ b/lib/libchardriver/chardriver.c @@ -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; diff --git a/servers/avfs/device.c b/servers/avfs/device.c index 969ac8b7d..e6e019978 100644 --- a/servers/avfs/device.c +++ b/servers/avfs/device.c @@ -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 diff --git a/servers/vfs/main.c b/servers/vfs/main.c index 34165898a..c9bd692e3 100644 --- a/servers/vfs/main.c +++ b/servers/vfs/main.c @@ -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; -- 2.44.0