[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 01/03: Look up device file name on device_open
From: |
Samuel Thibault |
Subject: |
[hurd] 01/03: Look up device file name on device_open |
Date: |
Mon, 16 Sep 2013 07:41:27 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch dde
in repository hurd.
commit 1521cb49429b33259c11f27b6175d691d3055025
Author: rekado <address@hidden>
Date: Thu Sep 12 14:10:55 2013 +0800
Look up device file name on device_open
A fresh `master_device' port is now obtained when accessing the device
file, not only on translator startup. This ensures that the device
can be re-opened after netdde has died.
* devnode/devnode.c (ds_device_open): When `master_file' is not NULL,
re-acquire a fresh `master_device' value by calling file_name_lookup again.
---
devnode/devnode.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/devnode/devnode.c b/devnode/devnode.c
index 50011aa..218b308 100644
--- a/devnode/devnode.c
+++ b/devnode/devnode.c
@@ -164,6 +164,16 @@ ds_device_open (mach_port_t master_port, mach_port_t
reply_port,
|| device_name == NULL)
return D_NO_SUCH_DEVICE;
+ if (master_file != NULL)
+ {
+ if (master_device != MACH_PORT_NULL)
+ mach_port_deallocate (mach_task_self (), master_device);
+
+ master_device = file_name_lookup (master_file, 0, 0);
+ if (master_device == MACH_PORT_NULL)
+ error (1, errno, "file_name_lookup");
+ }
+
err = device_open (master_device, mode, device_name, device);
*devicetype = MACH_MSG_TYPE_MOVE_SEND;
return err;
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git