static Lisp_Object call_process (ptrdiff_t, Lisp_Object *, int, ptrdiff_t);
\f
-
-#ifndef MSDOS
-/* Block SIGCHLD. */
-
-void
-block_child_signal (void)
-{
- sigset_t blocked;
- sigemptyset (&blocked);
- sigaddset (&blocked, SIGCHLD);
- pthread_sigmask (SIG_BLOCK, &blocked, 0);
-}
-
-/* Unblock SIGCHLD. */
-
-void
-unblock_child_signal (void)
-{
- pthread_sigmask (SIG_SETMASK, &empty_mask, 0);
-}
-
-#endif /* !MSDOS */
-
/* Return the current buffer's working directory, or the home
directory if it's unreachable, as a string suitable for a system call.
Signal an error if the result would not be an accessible directory. */
record_kill_process (struct Lisp_Process *p, Lisp_Object tempfile)
{
#ifndef MSDOS
- block_child_signal ();
+ sigset_t oldset;
+ block_child_signal (&oldset);
if (p->alive)
{
kill (- p->pid, SIGKILL);
}
- unblock_child_signal ();
+ unblock_child_signal (&oldset);
#endif /* !MSDOS */
}
char *tempfile = NULL;
int pid;
#else
+ sigset_t oldset;
pid_t pid;
#endif
int child_errno;
#ifndef MSDOS
block_input ();
- block_child_signal ();
+ block_child_signal (&oldset);
#ifdef WINDOWSNT
pid = child_setup (filefd, fd_output, fd_error, new_argv, 0, current_dir);
Lisp_Object volatile coding_systems_volatile = coding_systems;
Lisp_Object volatile current_dir_volatile = current_dir;
bool volatile display_p_volatile = display_p;
- bool volatile sa_must_free_volatile = sa_must_free;
int volatile fd_error_volatile = fd_error;
int volatile filefd_volatile = filefd;
ptrdiff_t volatile count_volatile = count;
- ptrdiff_t volatile sa_count_volatile = sa_count;
char **volatile new_argv_volatile = new_argv;
int volatile callproc_fd_volatile[CALLPROC_FDS];
for (i = 0; i < CALLPROC_FDS; i++)
coding_systems = coding_systems_volatile;
current_dir = current_dir_volatile;
display_p = display_p_volatile;
- sa_must_free = sa_must_free_volatile;
fd_error = fd_error_volatile;
filefd = filefd_volatile;
count = count_volatile;
- sa_count = sa_count_volatile;
new_argv = new_argv_volatile;
for (i = 0; i < CALLPROC_FDS; i++)
if (pid == 0)
{
- unblock_child_signal ();
+ unblock_child_signal (&oldset);
setsid ();
}
}
- unblock_child_signal ();
+ unblock_child_signal (&oldset);
unblock_input ();
if (pid < 0)
/* Now NREAD is the total amount of data in the buffer. */
immediate_quit = 0;
- if (NILP (BVAR (current_buffer, enable_multibyte_characters))
- && ! CODING_MAY_REQUIRE_DECODING (&process_coding))
+ if (!nread)
+ ;
+ else if (NILP (BVAR (current_buffer, enable_multibyte_characters))
+ && ! CODING_MAY_REQUIRE_DECODING (&process_coding))
insert_1_both (buf, nread, nread, 0, 1, 0);
else
{ /* We have to decode the input. */
ptrdiff_t count1 = SPECPDL_INDEX ();
XSETBUFFER (curbuf, current_buffer);
+ /* FIXME: Call signal_after_change! */
prepare_to_modify_buffer (PT, PT, NULL);
/* We cannot allow after-change-functions be run
during decoding, because that might modify the
srcdir = Fexpand_file_name (build_string ("../src/"), lispdir);
- tem = Fexpand_file_name (build_string ("GNU"), Vdata_directory);
+ tem = Fexpand_file_name (build_string ("NEWS"), Vdata_directory);
tem1 = Ffile_exists_p (tem);
if (!NILP (Fequal (srcdir, Vinvocation_directory)) || NILP (tem1))
{
Lisp_Object newdir;
newdir = Fexpand_file_name (build_string ("../etc/"), lispdir);
- tem = Fexpand_file_name (build_string ("GNU"), newdir);
+ tem = Fexpand_file_name (build_string ("NEWS"), newdir);
tem1 = Ffile_exists_p (tem);
if (!NILP (tem1))
Vdata_directory = newdir;
void
syms_of_callproc (void)
{
+#include "callproc.x"
+
#ifndef DOS_NT
Vtemp_file_name_pattern = build_string ("emacsXXXXXX");
#else /* DOS_NT */
See `setenv' and `getenv'. */);
Vprocess_environment = Qnil;
-
- defsubr (&Scall_process);
- defsubr (&Sgetenv_internal);
- defsubr (&Scall_process_region);
}