{
add_keyboard_wait_descriptor (fd);
+ eassert (0 <= fd && fd < FD_SETSIZE);
fd_callback_info[fd].func = func;
fd_callback_info[fd].data = data;
}
add_process_read_fd (int fd)
{
add_non_keyboard_read_fd (fd);
+ eassert (0 <= fd && fd < FD_SETSIZE);
fd_callback_info[fd].flags |= PROCESS_FD;
}
{
delete_keyboard_wait_descriptor (fd);
+ eassert (0 <= fd && fd < FD_SETSIZE);
if (fd_callback_info[fd].flags == 0)
{
fd_callback_info[fd].func = 0;
{
int fd;
+ eassert (max_desc < FD_SETSIZE);
for (fd = max_desc; fd >= 0; --fd)
{
if (fd_callback_info[fd].flags != 0)
break;
}
}
+ eassert (max_desc < FD_SETSIZE);
}
/* Stop monitoring file descriptor FD for when write is possible. */
void
delete_write_fd (int fd)
{
+ eassert (0 <= fd && fd < FD_SETSIZE);
if ((fd_callback_info[fd].flags & NON_BLOCKING_CONNECT_FD) != 0)
{
if (--num_pending_connects < 0)
int fd;
FD_ZERO (mask);
+ eassert (max_desc < FD_SETSIZE);
for (fd = 0; fd <= max_desc; ++fd)
{
if (fd_callback_info[fd].thread != NULL
int fd;
FD_ZERO (mask);
+ eassert (max_desc < FD_SETSIZE);
for (fd = 0; fd <= max_desc; ++fd)
{
if (fd_callback_info[fd].thread != NULL
int fd;
FD_ZERO (mask);
+ eassert (max_desc < FD_SETSIZE);
for (fd = 0; fd <= max_desc; ++fd)
{
if (fd_callback_info[fd].thread != NULL
int fd;
FD_ZERO (mask);
+ eassert (max_desc < FD_SETSIZE);
for (fd = 0; fd <= max_desc; ++fd)
{
if (fd_callback_info[fd].thread != NULL
{
int fd;
+ eassert (max_desc < FD_SETSIZE);
for (fd = 0; fd <= max_desc; ++fd)
{
if (fd_callback_info[fd].waiting_thread == current_thread)
struct Lisp_Process *proc = XPROCESS (process);
pset_thread (proc, Qnil);
+ eassert (proc->infd < FD_SETSIZE);
if (proc->infd >= 0)
fd_callback_info[proc->infd].thread = NULL;
+ eassert (proc->outfd < FD_SETSIZE);
if (proc->outfd >= 0)
fd_callback_info[proc->outfd].thread = NULL;
}
proc = XPROCESS (process);
pset_thread (proc, thread);
+ eassert (proc->infd < FD_SETSIZE);
if (proc->infd >= 0)
fd_callback_info[proc->infd].thread = tstate;
+ eassert (proc->outfd < FD_SETSIZE);
if (proc->outfd >= 0)
fd_callback_info[proc->outfd].thread = tstate;
fcntl (outchannel, F_SETFL, O_NONBLOCK);
/* Record this as an active process, with its channels. */
+ eassert (0 <= inchannel && inchannel < FD_SETSIZE);
chan_process[inchannel] = process;
p->infd = inchannel;
p->outfd = outchannel;
/* Record this as an active process, with its channels.
As a result, child_setup will close Emacs's side of the pipes. */
+ eassert (0 <= pty_fd && pty_fd < FD_SETSIZE);
chan_process[pty_fd] = process;
p->infd = pty_fd;
p->outfd = pty_fd;
#endif
/* Record this as an active process, with its channels. */
+ eassert (0 <= inchannel && inchannel < FD_SETSIZE);
chan_process[inchannel] = proc;
p->infd = inchannel;
p->outfd = outchannel;
return Qnil;
channel = XPROCESS (process)->infd;
+ eassert (0 <= channel && channel < FD_SETSIZE);
return conv_sockaddr_to_lisp (datagram_address[channel].sa,
datagram_address[channel].len);
}
channel = XPROCESS (process)->infd;
len = get_lisp_to_sockaddr_size (address, &family);
+ eassert (0 <= channel && channel < FD_SETSIZE);
if (len == 0 || datagram_address[channel].len != len)
return Qnil;
conv_lisp_to_sockaddr (family, address, datagram_address[channel].sa, len);
p->outfd = fd;
if (fd > max_desc)
max_desc = fd;
+ eassert (0 <= fd && fd < FD_SETSIZE);
chan_process[fd] = proc;
buffer = Fplist_get (contact, QCbuffer);
Fplist_get (contact, QChost),
Fplist_get (contact, QCservice));
+ eassert (p->outfd < FD_SETSIZE);
if (NILP (result))
{
pset_status (p, list2 (Qfailed,
#ifdef DATAGRAM_SOCKETS
if (p->socktype == SOCK_DGRAM)
{
+ eassert (0 <= s && s < FD_SETSIZE);
if (datagram_address[s].sa)
emacs_abort ();
inch = s;
outch = s;
+ eassert (0 <= inch && inch < FD_SETSIZE);
chan_process[inch] = proc;
fcntl (inch, F_SETFL, O_NONBLOCK);
if (! (connecting_status (p->status)
&& EQ (XCDR (p->status), addrinfos)))
pset_status (p, Fcons (Qconnect, addrinfos));
+ eassert (0 <= inch && inch < FD_SETSIZE);
if ((fd_callback_info[inch].flags & NON_BLOCKING_CONNECT_FD) == 0)
add_non_blocking_write_fd (inch);
}
close_process_fd (&p->open_fd[i]);
inchannel = p->infd;
+ eassert (inchannel < FD_SETSIZE);
if (inchannel >= 0)
{
p->infd = -1;
Lisp_Object name = Fformat (nargs, args);
Lisp_Object proc = make_process (name);
+ eassert (0 <= s && s < FD_SETSIZE);
chan_process[s] = proc;
fcntl (s, F_SETFL, O_NONBLOCK);
if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell)))
break;
+ eassert (max_desc < FD_SETSIZE);
+
#if defined HAVE_GETADDRINFO_A || defined HAVE_GNUTLS
{
Lisp_Object process_list_head, aproc;
{
ssize_t nbytes;
struct Lisp_Process *p = XPROCESS (proc);
+ eassert (0 <= channel && channel < FD_SETSIZE);
struct coding_system *coding = proc_decode_coding_system[channel];
int carryover = p->decoding_carryover;
ptrdiff_t readmax = clip_to_bounds (1, read_process_output_max, PTRDIFF_MAX);
proc_encode_coding_system[p->outfd] surely points to a
valid memory because p->outfd will be changed once EOF is
sent to the process. */
+ eassert (p->outfd < FD_SETSIZE);
if (NILP (p->encode_coding_system) && p->outfd >= 0
&& proc_encode_coding_system[p->outfd])
{
if (p->outfd < 0)
error ("Output file descriptor of %s is closed", SDATA (p->name));
+ eassert (p->outfd < FD_SETSIZE);
coding = proc_encode_coding_system[p->outfd];
Vlast_coding_system_used = CODING_ID_NAME (coding->id);
/* Send this batch, using one or more write calls. */
ptrdiff_t written = 0;
int outfd = p->outfd;
+ eassert (0 <= outfd && outfd < FD_SETSIZE);
#ifdef DATAGRAM_SOCKETS
if (DATAGRAM_CHAN_P (outfd))
{
struct Lisp_Process *p;
p = XPROCESS (process);
+ eassert (p->infd < FD_SETSIZE);
if (EQ (p->command, Qt)
&& p->infd >= 0
&& (!EQ (p->filter, Qt) || EQ (p->status, Qlisten)))
outfd = XPROCESS (proc)->outfd;
+ eassert (outfd < FD_SETSIZE);
if (outfd >= 0)
coding = proc_encode_coding_system[outfd];
p->open_fd[WRITE_TO_SUBPROCESS] = new_outfd;
p->outfd = new_outfd;
+ eassert (0 <= new_outfd && new_outfd < FD_SETSIZE);
if (!proc_encode_coding_system[new_outfd])
proc_encode_coding_system[new_outfd]
= xmalloc (sizeof (struct coding_system));
if (old_outfd >= 0)
{
+ eassert (old_outfd < FD_SETSIZE);
*proc_encode_coding_system[new_outfd]
= *proc_encode_coding_system[old_outfd];
memset (proc_encode_coding_system[old_outfd], 0,
struct Lisp_Process *p = XPROCESS (process);
if (p->infd < 0)
return Qnil;
+ eassert (p->infd < FD_SETSIZE);
struct coding_system *coding = proc_decode_coding_system[p->infd];
return (CODING_FOR_UNIBYTE (coding) ? Qnil : Qt);
}
{
int fd;
+ eassert (max_desc < FD_SETSIZE);
for (fd = 0; fd <= max_desc; fd++)
if (FD_ISSET (fd, mask)
&& ((fd_callback_info[fd].flags & (FOR_READ | KEYBOARD_FD))
void
add_timer_wait_descriptor (int fd)
{
+ eassert (0 <= fd && fd < FD_SETSIZE);
add_read_fd (fd, timerfd_callback, NULL);
fd_callback_info[fd].flags &= ~KEYBOARD_FD;
}
if (inch < 0 || outch < 0)
return;
+ eassert (0 <= inch && inch < FD_SETSIZE);
if (!proc_decode_coding_system[inch])
proc_decode_coding_system[inch] = xmalloc (sizeof (struct coding_system));
coding_system = p->decode_coding_system;
}
setup_coding_system (coding_system, proc_decode_coding_system[inch]);
+ eassert (0 <= outch && outch < FD_SETSIZE);
if (!proc_encode_coding_system[outch])
proc_encode_coding_system[outch] = xmalloc (sizeof (struct coding_system));
setup_coding_system (p->encode_coding_system,