aboutsummaryrefslogtreecommitdiff
path: root/libmachdev
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2023-01-01 13:20:53 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-01-01 13:20:53 +0100
commit1589f5fbe8fd87858d1a06517db5a7baae918f4f (patch)
treecb78afc11c0ced7fab36d3bb1195bb7d06f95e81 /libmachdev
parentec31a6b9578148086fa6c698ea75230468b52e4c (diff)
downloadhurd-1589f5fbe8fd87858d1a06517db5a7baae918f4f.tar.gz
hurd-1589f5fbe8fd87858d1a06517db5a7baae918f4f.tar.bz2
hurd-1589f5fbe8fd87858d1a06517db5a7baae918f4f.zip
Do not ignore value returned by get_privileged_ports
Diffstat (limited to 'libmachdev')
-rw-r--r--libmachdev/ds_routines.c8
-rw-r--r--libmachdev/trivfs_server.c8
2 files changed, 12 insertions, 4 deletions
diff --git a/libmachdev/ds_routines.c b/libmachdev/ds_routines.c
index c5a7cd00..cc99e296 100644
--- a/libmachdev/ds_routines.c
+++ b/libmachdev/ds_routines.c
@@ -117,9 +117,11 @@ ds_device_open (mach_port_t open_port, mach_port_t reply_port,
/* Fall back to opening kernel device master */
if (err)
{
- get_privileged_ports(NULL, &dev_master);
- err = device_open (dev_master, mode, name, devp);
- *devicePoly = MACH_MSG_TYPE_MOVE_SEND;
+ err = get_privileged_ports(NULL, &dev_master);
+ if (!err)
+ err = device_open (dev_master, mode, name, devp);
+ if (!err)
+ *devicePoly = MACH_MSG_TYPE_MOVE_SEND;
}
return err;
}
diff --git a/libmachdev/trivfs_server.c b/libmachdev/trivfs_server.c
index 979741d1..9c9f817d 100644
--- a/libmachdev/trivfs_server.c
+++ b/libmachdev/trivfs_server.c
@@ -221,8 +221,14 @@ static void
essential_task (void)
{
mach_port_t host, startup;
+ error_t err;
- get_privileged_ports (&host, 0);
+ err = get_privileged_ports (&host, 0);
+ if (err)
+ {
+ mach_print ("WARNING: Cannot register as essential task\n");
+ return;
+ }
startup = file_name_lookup (_SERVERS_STARTUP, 0, 0);
if (startup == MACH_PORT_NULL)
{