summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <pochu27@gmail.com>2010-05-26 01:27:40 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-01-08 22:46:06 +0100
commit4152b0ca04f4703a6c6f33e59ba0e7bd95837069 (patch)
treee10f7b717da381cacf8a5d98087d664f271f3bba /utils
parent67fa50fb8f0a6894e5ed6534936afb8044e66613 (diff)
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.
Diffstat (limited to 'utils')
-rw-r--r--utils/login.c25
1 files changed, 18 insertions, 7 deletions
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 <miles@gnu.org>
@@ -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);