report_file_error ("Setting current directory",
BVAR (current_buffer, directory));
- RETURN_UNGCPRO (dir);
+ return dir;
}
/* If P is reapable, record it as a deleted process and kill it.
Lisp_Object infile, encoded_infile;
int filefd;
struct gcpro gcpro1;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
if (nargs >= 2 && ! NILP (args[1]))
{
report_file_error ("Opening process input file", infile);
record_unwind_protect_ptr (close_file_ptr_unwind, &filefd);
UNGCPRO;
- return unbind_to (count, call_process (nargs, args, &filefd, NULL));
+ Lisp_Object tem0 = call_process (nargs, args, &filefd, NULL);
+ dynwind_end ();
+ return tem0;
}
/* Like Fcall_process (NARGS, ARGS), except use FILEFD as the input file.
val = complement_process_encoding_system (val);
{
- ptrdiff_t count1 = SPECPDL_INDEX ();
+ dynwind_begin ();
specbind (intern ("coding-system-for-write"), val);
/* POSIX lets mk[s]temp use "."; don't invoke jka-compr if we
specbind (intern ("file-name-handler-alist"), Qnil);
write_region (start, end, filename_string, Qnil, Qlambda, Qnil, Qnil, fd);
- unbind_to (count1, Qnil);
+ dynwind_end ();
}
if (lseek (fd, 0, SEEK_SET) < 0)
{
struct gcpro gcpro1;
Lisp_Object infile, val;
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object start = args[0];
Lisp_Object end = args[1];
bool empty_input;
args[1] = infile;
val = call_process (nargs, args, &fd, &infile);
- RETURN_UNGCPRO (unbind_to (count, val));
+ dynwind_end ();
+ return val;
}
\f
#ifndef WINDOWSNT