diff options
author | Michael I. Bushnell <mib@gnu.org> | 1996-05-09 23:08:55 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1996-05-09 23:08:55 +0000 |
commit | ba560249054236af4da59040803894b21ae4e7e1 (patch) | |
tree | 99949fe7afd8e24b8d62c196aab37bad93b4ee0d /init/init.c | |
parent | b2f4555adbd9afccdfabdcb0cbc0deca88039e3d (diff) |
Include <hurd/startup_notify.h>.
(struct ntfy_task): New member `name'.
(S_startup_request_notification): Expect and record name.
(S_msg_startup_dosync): Delete function.
(reboot_system): Use new startup_dosync interface.
(init_stdarrays): Use new authentication interface.
Diffstat (limited to 'init/init.c')
-rw-r--r-- | init/init.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/init/init.c b/init/init.c index dae491e4..5e1aa9cb 100644 --- a/init/init.c +++ b/init/init.c @@ -39,6 +39,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <sys/wait.h> #include <hurd/msg_server.h> #include <wire.h> +#include <hurd/startup_notify.h> #include "startup_reply_U.h" #include "startup_S.h" @@ -55,6 +56,7 @@ struct ntfy_task { mach_port_t notify_port; struct ntfy_task *next; + char *name; }; /* This structure keeps track of each registered essential task. */ @@ -156,11 +158,7 @@ reboot_system (int flags) error_t err; printf ("init: notifying %p\n", (void *) n->notify_port); fflush (stdout); -#ifdef notyet - err = msg_startup_dosync (n->notify_port, 60000); /* 1 minute to reply */ -#else - err = msg_startup_dosync (n->notify_port); -#endif + err = startup_dosync (n->notify_port, 60000); /* 1 minute to reply */ if (err && err != MACH_SEND_INVALID_DEST) { printf ("init: %p complained: %s\n", @@ -581,7 +579,7 @@ init_stdarrays () pt = getcwdir (); ref = mach_reply_port (); io_reauthenticate (pt, ref, MACH_MSG_TYPE_MAKE_SEND); - auth_user_authenticate (nullauth, pt, ref, MACH_MSG_TYPE_MAKE_SEND, + auth_user_authenticate (nullauth, ref, MACH_MSG_TYPE_MAKE_SEND, &std_port_array[INIT_PORT_CWDIR]); mach_port_destroy (mach_task_self (), ref); mach_port_deallocate (mach_task_self (), pt); @@ -589,7 +587,7 @@ init_stdarrays () pt = getcrdir (); ref = mach_reply_port (); io_reauthenticate (pt, ref, MACH_MSG_TYPE_MAKE_SEND); - auth_user_authenticate (nullauth, pt, ref, MACH_MSG_TYPE_MAKE_SEND, + auth_user_authenticate (nullauth, ref, MACH_MSG_TYPE_MAKE_SEND, &std_port_array[INIT_PORT_CRDIR]); mach_port_destroy (mach_task_self (), ref); mach_port_deallocate (mach_task_self (), pt); @@ -873,7 +871,8 @@ S_startup_essential_task (mach_port_t server, kern_return_t S_startup_request_notification (mach_port_t server, - mach_port_t notify) + mach_port_t notify, + char *name) { struct ntfy_task *nt; mach_port_t prev; @@ -888,6 +887,8 @@ S_startup_request_notification (mach_port_t server, nt->notify_port = notify; nt->next = ntfy_tasks; ntfy_tasks = nt; + nt->name = malloc (strlen (name) + 1); + strcpy (nt->name, nt->name); return 0; } @@ -1183,10 +1184,6 @@ S_msg_set_env_variable (mach_port_t process, { return _S_msg_set_env_variable (process, refport, variable, value, replace); } kern_return_t -S_msg_startup_dosync (mach_port_t process) -{ return _S_msg_startup_dosync (process); } - -kern_return_t S_msg_get_exec_flags (mach_port_t process, mach_port_t refport, int *flags) { return _S_msg_get_exec_flags (process, refport, flags); } kern_return_t |