summaryrefslogtreecommitdiff
path: root/exec
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 /exec
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 'exec')
-rw-r--r--exec/hashexec.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/exec/hashexec.c b/exec/hashexec.c
index e8e94844..a7368390 100644
--- a/exec/hashexec.c
+++ b/exec/hashexec.c
@@ -423,16 +423,32 @@ check_hashbang (struct execdata *e,
/* We cannot open the interpreter file to execute it. Lose! */
return;
+#ifdef HAVE_FILE_EXEC_PATHS
/* Execute the interpreter program. */
- e->error = file_exec (interp_file,
- oldtask, flags,
- new_argv, new_argvlen, envp, envplen,
- new_dtable ?: dtable, MACH_MSG_TYPE_COPY_SEND,
- new_dtable ? new_dtablesize : dtablesize,
- portarray, MACH_MSG_TYPE_COPY_SEND, nports,
- intarray, nints,
- deallocnames, ndeallocnames,
- destroynames, ndestroynames);
+ e->error = file_exec_paths (interp_file,
+ oldtask, flags, interp, interp,
+ new_argv, new_argvlen, envp, envplen,
+ new_dtable ?: dtable,
+ MACH_MSG_TYPE_COPY_SEND,
+ new_dtable ? new_dtablesize : dtablesize,
+ portarray, MACH_MSG_TYPE_COPY_SEND, nports,
+ intarray, nints,
+ deallocnames, ndeallocnames,
+ destroynames, ndestroynames);
+ /* For backwards compatibility. Just drop it when we kill file_exec. */
+ if (e->error == MIG_BAD_ID)
+#endif
+ e->error = file_exec (interp_file,
+ oldtask, flags,
+ new_argv, new_argvlen, envp, envplen,
+ new_dtable ?: dtable, MACH_MSG_TYPE_COPY_SEND,
+ new_dtable ? new_dtablesize : dtablesize,
+ portarray, MACH_MSG_TYPE_COPY_SEND, nports,
+ intarray, nints,
+ deallocnames, ndeallocnames,
+ destroynames, ndestroynames);
+
+
mach_port_deallocate (mach_task_self (), interp_file);
munmap (new_argv, new_argvlen);