comparison src/callproc.c @ 19967:685d256c8cb5

(child_setup) [WINDOWSNT]: Change directory of child instead of parent.
author Geoff Voelker <voelker@cs.washington.edu>
date Tue, 23 Sep 1997 17:30:24 +0000
parents 7e1bbe58eb02
children c743e52dd2b0
comparison
equal deleted inserted replaced
19966:70b47bd8c5c6 19967:685d256c8cb5
952 bcopy ("PWD=", pwd_var, 4); 952 bcopy ("PWD=", pwd_var, 4);
953 bcopy (XSTRING (current_dir)->data, temp, i); 953 bcopy (XSTRING (current_dir)->data, temp, i);
954 if (!IS_DIRECTORY_SEP (temp[i - 1])) temp[i++] = DIRECTORY_SEP; 954 if (!IS_DIRECTORY_SEP (temp[i - 1])) temp[i++] = DIRECTORY_SEP;
955 temp[i] = 0; 955 temp[i] = 0;
956 956
957 #ifndef WINDOWSNT
957 /* We can't signal an Elisp error here; we're in a vfork. Since 958 /* We can't signal an Elisp error here; we're in a vfork. Since
958 the callers check the current directory before forking, this 959 the callers check the current directory before forking, this
959 should only return an error if the directory's permissions 960 should only return an error if the directory's permissions
960 are changed between the check and this chdir, but we should 961 are changed between the check and this chdir, but we should
961 at least check. */ 962 at least check. */
962 if (chdir (temp) < 0) 963 if (chdir (temp) < 0)
963 _exit (errno); 964 _exit (errno);
965 #endif
964 966
965 /* Strip trailing slashes for PWD, but leave "/" and "//" alone. */ 967 /* Strip trailing slashes for PWD, but leave "/" and "//" alone. */
966 while (i > 2 && IS_DIRECTORY_SEP (temp[i - 1])) 968 while (i > 2 && IS_DIRECTORY_SEP (temp[i - 1]))
967 temp[--i] = 0; 969 temp[--i] = 0;
968 } 970 }
1018 } 1020 }
1019 *new_env = 0; 1021 *new_env = 0;
1020 } 1022 }
1021 #ifdef WINDOWSNT 1023 #ifdef WINDOWSNT
1022 prepare_standard_handles (in, out, err, handles); 1024 prepare_standard_handles (in, out, err, handles);
1025 set_process_dir (XSTRING (current_dir)->data);
1023 #else /* not WINDOWSNT */ 1026 #else /* not WINDOWSNT */
1024 /* Make sure that in, out, and err are not actually already in 1027 /* Make sure that in, out, and err are not actually already in
1025 descriptors zero, one, or two; this could happen if Emacs is 1028 descriptors zero, one, or two; this could happen if Emacs is
1026 started with its standard in, out, or error closed, as might 1029 started with its standard in, out, or error closed, as might
1027 happen under X. */ 1030 happen under X. */