summaryrefslogtreecommitdiff
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
commitb4bd1c52ebf6531164d86bd8cf6c830ba3210eb8 (patch)
tree5792c4ac22f4ec7bf6622466b968767ae1676570
parent9ccc4c2d44b7ccb78ce432d0bd0b482dc9551edd (diff)
(dev_open): Record NAME in the returned dev structure.
-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