[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 25/64: boot: remove unused function `boot_script_read_file'
From: |
Samuel Thibault |
Subject: |
[hurd] 25/64: boot: remove unused function `boot_script_read_file' |
Date: |
Wed, 10 Dec 2014 15:17:05 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit a99d8b562d74e3b08c88d52433914d9c1c6bd362
Author: Justus Winter <address@hidden>
Date: Thu Nov 6 13:59:59 2014 +0100
boot: remove unused function `boot_script_read_file'
The unused function `boot_script_read_file' requires access to the
default pager, which is privileged.
* boot/boot.c (defpager): Remove now unused variable.
(boot_script_read_file): Remove unused function.
(main): Do not acquire port to the default pager.
* boot/boot_script.h (boot_script_read_file): Remove declaration.
---
boot/boot.c | 46 +---------------------------------------------
boot/boot_script.h | 4 ----
2 files changed, 1 insertion(+), 49 deletions(-)
diff --git a/boot/boot.c b/boot/boot.c
index d5b8096..250018e 100644
--- a/boot/boot.c
+++ b/boot/boot.c
@@ -109,7 +109,7 @@ typedef struct stat host_stat_t;
#endif /* UX */
-mach_port_t privileged_host_port, master_device_port, defpager;
+mach_port_t privileged_host_port, master_device_port;
mach_port_t pseudo_master_device_port;
mach_port_t receive_set;
mach_port_t pseudo_console, pseudo_root;
@@ -281,47 +281,6 @@ void read_reply ();
void * msg_thread (void *);
/* Callbacks for boot_script.c; see boot_script.h. */
-
-mach_port_t
-boot_script_read_file (const char *filename)
-{
- static const char msg[] = ": cannot open\n";
- int fd = useropen (filename, O_RDONLY, 0);
- host_stat_t st;
- error_t err;
- mach_port_t memobj;
- vm_address_t region;
-
- write (2, filename, strlen (filename));
- if (fd < 0)
- {
- write (2, msg, sizeof msg - 1);
- host_exit (1);
- }
- else
- write (2, msg + sizeof msg - 2, 1);
-
- host_fstat (fd, &st);
-
- err = default_pager_object_create (defpager, &memobj,
- round_page (st.st_size));
- if (err)
- {
- static const char msg[] = "cannot create default-pager object\n";
- write (2, msg, sizeof msg - 1);
- host_exit (1);
- }
-
- region = 0;
- vm_map (mach_task_self (), ®ion, round_page (st.st_size),
- 0, 1, memobj, 0, 0, VM_PROT_ALL, VM_PROT_ALL, VM_INHERIT_NONE);
- read (fd, (char *) region, st.st_size);
- munmap ((caddr_t) region, round_page (st.st_size));
-
- close (fd);
- return memobj;
-}
-
int
boot_script_exec_cmd (void *hook,
mach_port_t task, char *path, int argc,
@@ -532,9 +491,6 @@ main (int argc, char **argv, char **envp)
get_privileged_ports (&privileged_host_port, &master_device_port);
- defpager = MACH_PORT_NULL;
- vm_set_default_memory_manager (privileged_host_port, &defpager);
-
strcat (bootstrap_args, "f");
mach_port_allocate (mach_task_self (), MACH_PORT_RIGHT_PORT_SET,
diff --git a/boot/boot_script.h b/boot/boot_script.h
index 6245869..da52e6f 100644
--- a/boot/boot_script.h
+++ b/boot/boot_script.h
@@ -69,10 +69,6 @@ int boot_script_exec_cmd (void *hook,
task_t task, char *path, int argc,
char **argv, char *strings, int stringlen);
-/* The user must define this function. Load the contents of FILE
- into a fresh anonymous memory object and return the memory object port. */
-mach_port_t boot_script_read_file (const char *file);
-
/* The user must define this functions to perform the corresponding
Mach task manipulations. */
int boot_script_task_create (struct cmd *); /* task_create + task_suspend */
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] branch upstream updated (e4a9a4d -> 4c7abe4), Samuel Thibault, 2014/12/10
- [hurd] 09/64: Fix recording complete path of passive relative translators, Samuel Thibault, 2014/12/10
- [hurd] 10/64: Fix compiler warning, Samuel Thibault, 2014/12/10
- [hurd] 12/64: trans/mtab: avoid firmlink loops, Samuel Thibault, 2014/12/10
- [hurd] 15/64: startup: rename /hurd/init to /hurd/startup, Samuel Thibault, 2014/12/10
- [hurd] 11/64: Always canonicalize fstab entries with realpath, Samuel Thibault, 2014/12/10
- [hurd] 23/64: startup: also open `console' for reading, Samuel Thibault, 2014/12/10
- [hurd] 26/64: boot: drop obsolete device procedures, Samuel Thibault, 2014/12/10
- [hurd] 16/64: init: add a minimalist init program, Samuel Thibault, 2014/12/10
- [hurd] 22/64: proc: gracefully handle failure to increase priority, Samuel Thibault, 2014/12/10
- [hurd] 25/64: boot: remove unused function `boot_script_read_file',
Samuel Thibault <=
- [hurd] 31/64: libdiskfs: fix fabrication of protid, Samuel Thibault, 2014/12/10
- [hurd] 17/64: startup: do not pass signals on to the child, Samuel Thibault, 2014/12/10
- [hurd] 29/64: boot: improve the demuxer, Samuel Thibault, 2014/12/10
- [hurd] 14/64: procfs: do not hard-code the default argument values, Samuel Thibault, 2014/12/10
- [hurd] 32/64: Fix proc crashes, Samuel Thibault, 2014/12/10
- [hurd] 13/64: Add proc_set_init_task, make runsystem pid 1, Samuel Thibault, 2014/12/10
- [hurd] 40/64: libnetfs: add a payload-aware intrans function, Samuel Thibault, 2014/12/10
- [hurd] 21/64: Makeconf: handle the gnumach protocol, Samuel Thibault, 2014/12/10
- [hurd] 39/64: libdiskfs: add payload-aware intrans functions, Samuel Thibault, 2014/12/10
- [hurd] 18/64: startup: be more specific in the shutdown message, Samuel Thibault, 2014/12/10