From 645e15a460f41b9ff7271588fecfaf60fe9446a2 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 25 Jun 2002 05:07:25 +0000 Subject: 2002-06-14 Roland McGrath * tmpfs.c (main): If get_privileged_ports fails with EPERM, try to open /servers/default-pager instead. --- tmpfs/tmpfs.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tmpfs/tmpfs.c b/tmpfs/tmpfs.c index 47ab8a6c..928ebaa4 100644 --- a/tmpfs/tmpfs.c +++ b/tmpfs/tmpfs.c @@ -26,6 +26,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "tmpfs.h" #include #include +#include +#include +#include char *diskfs_server_name = "tmpfs"; char *diskfs_server_version = HURD_VERSION; @@ -287,7 +290,13 @@ main (int argc, char **argv) /* Get our port to the default pager. Without that, we have no place to put file contents. */ err = get_privileged_ports (&host_priv, NULL); - if (err) + if (err == EPERM) + { + default_pager = file_name_lookup (_SERVERS_DEFPAGER, O_EXEC, 0); + if (default_pager == MACH_PORT_NULL) + error (0, errno, _SERVERS_DEFPAGER); + } + else if (err) error (0, err, "Cannot get host privileged port"); else { -- cgit v1.2.3