From 4152b0ca04f4703a6c6f33e59ba0e7bd95837069 Mon Sep 17 00:00:00 2001 From: Emilio Pozuelo Monfort Date: Wed, 26 May 2010 01:27:40 +0200 Subject: Add a file_exec_file_name RPC * hurd/fs.defs (file_exec): Deprecate in favor of... (file_exec_paths): ...this new RPC. * TODO: Update. * doc/hurd.texi: Update RPC name. * hurd/hurd_types.h: Update RPC name. * libdiskfs/boot-start.c: Update RPC name. * configure.ac: Check for presence of RPC stubs file_exec_paths exec_exec_paths. * exec/hashexec.c (check_hashbang): When file_exec_paths is available, use it instead of file_exec. * startup/startup.c (run, run_for_real, start_child): Likewise. * utils/login.c (main): Likewise. * libfshelp/start-translator-long.c (fshelp_start_translator_long): Likewise. * libdiskfs/file-exec.c (diskfs_S_file_exec): Move code to new function diskfs_S_file_exec_paths and call it. (diskfs_S_file_exec_paths): New function, use exec_exec_paths when available instead of exec_exec * libnetfs/file-exec.c (netfs_S_file_exec, netfs_S_file_exec_paths): Likewise. * trans/fakeroot.c (netfs_S_file_exec, netfs_S_file_exec_paths): Likewise. * libtrivfs/file-exec.c (trivfs_S_file_exec_paths): New function. --- utils/login.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'utils/login.c') diff --git a/utils/login.c b/utils/login.c index 1a12c3cd..8d0cf92a 100644 --- a/utils/login.c +++ b/utils/login.c @@ -1,6 +1,7 @@ /* Hurdish login - Copyright (C) 1995,96,97,98,99,2002 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2002, 2010 + Free Software Foundation, Inc. Written by Miles Bader @@ -882,12 +883,22 @@ main(int argc, char *argv[]) } } - err = file_exec (exec, mach_task_self (), EXEC_DEFAULTS, - sh_args, sh_args_len, env, env_len, - fds, MACH_MSG_TYPE_COPY_SEND, 3, - ports, MACH_MSG_TYPE_COPY_SEND, INIT_PORT_MAX, - ints, INIT_INT_MAX, - 0, 0, 0, 0); +#ifdef HAVE_FILE_EXEC_PATHS + err = file_exec_paths (exec, mach_task_self (), EXEC_DEFAULTS, shell, shell, + sh_args, sh_args_len, env, env_len, + fds, MACH_MSG_TYPE_COPY_SEND, 3, + ports, MACH_MSG_TYPE_COPY_SEND, INIT_PORT_MAX, + ints, INIT_INT_MAX, + 0, 0, 0, 0); + /* Fallback in case the file server hasn't been restarted. */ + if (err == MIG_BAD_ID) +#endif + err = file_exec (exec, mach_task_self (), EXEC_DEFAULTS, + sh_args, sh_args_len, env, env_len, + fds, MACH_MSG_TYPE_COPY_SEND, 3, + ports, MACH_MSG_TYPE_COPY_SEND, INIT_PORT_MAX, + ints, INIT_INT_MAX, + 0, 0, 0, 0); if (err) error(5, err, "%s", shell); -- cgit v1.2.3