summaryrefslogtreecommitdiff
path: root/devio
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-10-01 20:18:13 +0000
committerMiles Bader <miles@gnu.org>1995-10-01 20:18:13 +0000
commitc208e71dc949e6e750450edade5f45fafb00dc4e (patch)
tree310d703502e9908c445fd65f8c3e2764198191e5 /devio
parent27aa5009fb27ae3b592e4c2160a298a0b45184a5 (diff)
(dev_open): Record NAME in the returned dev structure.
Diffstat (limited to 'devio')
-rw-r--r--devio/dev.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/devio/dev.c b/devio/dev.c
index b120c07c..f2183f3b 100644
--- a/devio/dev.c
+++ b/devio/dev.c
@@ -56,9 +56,15 @@ dev_open(char *name, int flags, int block_size, struct dev **dev)
if (*dev == NULL)
return ENOMEM;
+ (*dev)->name = malloc (strlen (name) + 1);
+ if ((*dev)->name)
+ strcpy ((*dev)->name, name);
+ else
+ err = ENOMEM;
+
(*dev)->port = MACH_PORT_NULL;
- if (device_master == MACH_PORT_NULL)
+ if (!err && device_master == MACH_PORT_NULL)
err = get_privileged_ports(NULL, &device_master);
#ifdef FAKE