summaryrefslogtreecommitdiff
path: root/src/callproc.c
diff options
context:
space:
mode:
authorPhilipp Stephani <phst@google.com>2020-12-23 16:26:57 +0100
committerPhilipp Stephani <phst@google.com>2020-12-23 16:26:57 +0100
commitbdcea81a2f906be3c573c42276dbfd35ccb432f9 (patch)
tree8780559b57846364b004aa4eadd75eecfd791f68 /src/callproc.c
parent95334ee79ab60c0910a5528e586a24d11f91743b (diff)
downloademacs-bdcea81a2f906be3c573c42276dbfd35ccb432f9.tar.gz
Pass C string pointer to current directory to 'child_setup'.
This avoids the impression that 'child_setup' could do anything Lisp-related. * src/callproc.c (child_setup): Pass C pointer to current directory name. (call_process): Adapt callers. * src/process.c (create_process): Adapt callers.
Diffstat (limited to 'src/callproc.c')
-rw-r--r--src/callproc.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/callproc.c b/src/callproc.c
index 93a8bb86417..bd8442ce2b9 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -544,8 +544,8 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
char *const *env = make_environment_block (current_dir);
#ifdef MSDOS /* MW, July 1993 */
- status
- = child_setup (filefd, fd_output, fd_error, new_argv, env, current_dir);
+ status = child_setup (filefd, fd_output, fd_error, new_argv, env,
+ SSDATA (current_dir));
if (status < 0)
{
@@ -592,7 +592,8 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
block_child_signal (&oldset);
#ifdef WINDOWSNT
- pid = child_setup (filefd, fd_output, fd_error, new_argv, env, current_dir);
+ pid = child_setup (filefd, fd_output, fd_error, new_argv, env,
+ SSDATA (current_dir));
#else /* not WINDOWSNT */
/* vfork, and prevent local vars from being clobbered by the vfork. */
@@ -651,7 +652,8 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
signal (SIGPROF, SIG_DFL);
#endif
- child_setup (filefd, fd_output, fd_error, new_argv, env, current_dir);
+ child_setup (filefd, fd_output, fd_error, new_argv, env,
+ SSDATA (current_dir));
}
#endif /* not WINDOWSNT */
@@ -1221,7 +1223,7 @@ exec_failed (char const *name, int err)
CHILD_SETUP_TYPE
child_setup (int in, int out, int err, char **new_argv, char *const *env,
- Lisp_Object current_dir)
+ const char *current_dir)
{
#ifdef WINDOWSNT
int cpid;
@@ -1243,13 +1245,13 @@ child_setup (int in, int out, int err, char **new_argv, char *const *env,
should only return an error if the directory's permissions
are changed between the check and this chdir, but we should
at least check. */
- if (chdir (SSDATA (current_dir)) < 0)
+ if (chdir (current_dir) < 0)
_exit (EXIT_CANCELED);
#endif
#ifdef WINDOWSNT
prepare_standard_handles (in, out, err, handles);
- set_process_dir (SSDATA (current_dir));
+ set_process_dir (current_dir);
/* Spawn the child. (See w32proc.c:sys_spawnve). */
cpid = spawnve (_P_NOWAIT, new_argv[0], new_argv, env);
reset_standard_handles (in, out, err, handles);