diff options
author | Miles Bader <miles@gnu.org> | 1995-10-01 20:18:13 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1995-10-01 20:18:13 +0000 |
commit | b4bd1c52ebf6531164d86bd8cf6c830ba3210eb8 (patch) | |
tree | 5792c4ac22f4ec7bf6622466b968767ae1676570 | |
parent | 9ccc4c2d44b7ccb78ce432d0bd0b482dc9551edd (diff) |
(dev_open): Record NAME in the returned dev structure.
-rw-r--r-- | devio/dev.c | 8 |
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 |