/* The largest descriptor currently in use for input; -1 if none. */
static int max_input_desc;
-/* Indexed by descriptor, gives the process (if any) for that descriptor */
+/* Indexed by descriptor, gives the process (if any) for that descriptor. */
static Lisp_Object chan_process[FD_SETSIZE];
-/* Alist of elements (NAME . PROCESS) */
+/* Alist of elements (NAME . PROCESS). */
static Lisp_Object Vprocess_alist;
/* Buffered-ahead input char from process, indexed by channel.
void *data;
#define FOR_READ 1
#define FOR_WRITE 2
- int condition; /* mask of the defines above. */
+ int condition; /* Mask of the defines above. */
} fd_callback_info[FD_SETSIZE];
have a race condition between the PTY_OPEN and here. */
fcntl (fd, F_SETFD, FD_CLOEXEC);
#endif
- /* check to make certain that both sides are available
- this avoids a nasty yet stupid bug in rlogins */
+ /* Check to make certain that both sides are available
+ this avoids a nasty yet stupid bug in rlogins. */
#ifdef PTY_TTY_NAME_SPRINTF
PTY_TTY_NAME_SPRINTF
#else
&& XINT (p->contents[i]) > 255)
return Qnil;
- args[i+1] = p->contents[i];
+ args[i + 1] = p->contents[i];
}
return Fformat (nargs + 1, args);
if (inchannel > max_process_desc)
max_process_desc = inchannel;
- /* This may signal an error. */
+ /* This may signal an error. */
setup_process_coding_systems (process);
block_input ();
{
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) sa;
uint16_t *ip6 = (uint16_t *) &sin6->sin6_addr;
- len = sizeof (sin6->sin6_addr)/2 + 1;
+ len = sizeof (sin6->sin6_addr) / 2 + 1;
address = Fmake_vector (make_number (len), Qnil);
p = XVECTOR (address);
p->contents[--len] = make_number (ntohs (sin6->sin6_port));
static const struct socket_options {
/* The name of this option. Should be lowercase version of option
- name without SO_ prefix. */
+ name without SO_ prefix. */
const char *name;
- /* Option level SOL_... */
+ /* Option level SOL_... */
int optlevel;
- /* Option number SO_... */
+ /* Option number SO_... */
int optnum;
enum { SOPT_UNKNOWN, SOPT_BOOL, SOPT_INT, SOPT_IFNAME, SOPT_LINGER } opttype;
- enum { OPIX_NONE=0, OPIX_MISC=1, OPIX_REUSEADDR=2 } optbit;
+ enum { OPIX_NONE = 0, OPIX_MISC = 1, OPIX_REUSEADDR = 2 } optbit;
} socket_options[] =
{
#ifdef SO_BINDTODEVICE
#ifdef SO_BINDTODEVICE
case SOPT_IFNAME:
{
- char devname[IFNAMSIZ+1];
+ char devname[IFNAMSIZ + 1];
/* This is broken, at least in the Linux 2.4 kernel.
To unbind, the arg must be a zero integer, not the empty string.
exactly like a normal process when reading and writing. Primary
differences are in status display and process deletion. A network
connection has no PID; you cannot signal it. All you can do is
- stop/continue it and deactivate/close it via delete-process */
+ stop/continue it and deactivate/close it via delete-process. */
DEFUN ("make-network-process", Fmake_network_process, Smake_network_process,
0, MANY, 0,
GCPRO1 (contact);
#ifdef WINDOWSNT
- /* Ensure socket support is loaded if available. */
+ /* Ensure socket support is loaded if available. */
init_winsock (TRUE);
#endif
{
if (EQ (host, Qlocal))
/* Depending on setup, "localhost" may map to different IPv4 and/or
- IPv6 addresses, so it's better to be explicit. (Bug#6781) */
+ IPv6 addresses, so it's better to be explicit (Bug#6781). */
host = build_string ("127.0.0.1");
CHECK_STRING (host);
}
address_in.sin_family = family;
}
else
- /* Attempt to interpret host as numeric inet address */
+ /* Attempt to interpret host as numeric inet address. */
{
unsigned long numeric_addr;
numeric_addr = inet_addr (SSDATA (host));
/* Parse network options in the arg list.
We simply ignore anything which isn't a known option (including other keywords).
An error is signaled if setting a known option fails. */
- for (optn = optbits = 0; optn < nargs-1; optn += 2)
- optbits |= set_socket_option (s, args[optn], args[optn+1]);
+ for (optn = optbits = 0; optn < nargs - 1; optn += 2)
+ optbits |= set_socket_option (s, args[optn], args[optn + 1]);
if (is_server)
{
{
/* Unlike most other syscalls connect() cannot be called
again. (That would return EALREADY.) The proper way to
- wait for completion is pselect(). */
+ wait for completion is pselect(). */
int sc;
socklen_t len;
fd_set fdset;
#endif
#ifdef IFF_NOTRAILERS
#ifdef NS_IMPL_COCOA
- /* Really means smart, notrailers is obsolete */
+ /* Really means smart, notrailers is obsolete. */
{ IFF_NOTRAILERS, "smart" },
#else
{ IFF_NOTRAILERS, "notrailers" },
{ IFF_DYNAMIC, "dynamic" },
#endif
#ifdef IFF_OACTIVE
- { IFF_OACTIVE, "oactive" }, /* OpenBSD: transmission in progress */
+ { IFF_OACTIVE, "oactive" }, /* OpenBSD: transmission in progress. */
#endif
#ifdef IFF_SIMPLEX
- { IFF_SIMPLEX, "simplex" }, /* OpenBSD: can't hear own transmissions */
+ { IFF_SIMPLEX, "simplex" }, /* OpenBSD: can't hear own transmissions. */
#endif
#ifdef IFF_LINK0
- { IFF_LINK0, "link0" }, /* OpenBSD: per link layer defined bit */
+ { IFF_LINK0, "link0" }, /* OpenBSD: per link layer defined bit. */
#endif
#ifdef IFF_LINK1
- { IFF_LINK1, "link1" }, /* OpenBSD: per link layer defined bit */
+ { IFF_LINK1, "link1" }, /* OpenBSD: per link layer defined bit. */
#endif
#ifdef IFF_LINK2
- { IFF_LINK2, "link2" }, /* OpenBSD: per link layer defined bit */
+ { IFF_LINK2, "link2" }, /* OpenBSD: per link layer defined bit. */
#endif
{ 0, 0 }
};
}
#endif
- /* Beware SIGCHLD hereabouts. */
+ /* Beware SIGCHLD hereabouts. */
for (i = 0; i < PROCESS_OPEN_FDS; i++)
close_process_fd (&p->open_fd[i]);
return
((wait_reading_process_output (secs, nsecs, 0, 0,
- Qnil,
- !NILP (process) ? XPROCESS (process) : NULL,
- NILP (just_this_one) ? 0 :
- !INTEGERP (just_this_one) ? 1 : -1)
+ Qnil,
+ !NILP (process) ? XPROCESS (process) : NULL,
+ (NILP (just_this_one) ? 0
+ : !INTEGERP (just_this_one) ? 1 : -1))
<= 0)
? Qnil : Qt);
}
{
Lisp_Object proc, caller, name, buffer;
Lisp_Object contact, host, service;
- struct Lisp_Process *ps= XPROCESS (server);
+ struct Lisp_Process *ps = XPROCESS (server);
struct Lisp_Process *p;
int s;
union u_sockaddr {
{
/* A negative timeout means
gobble output available now
- but don't wait at all. */
+ but don't wait at all. */
timeout = make_timespec (0, 0);
}
break;
}
- /* Wait till there is something to do */
+ /* Wait till there is something to do. */
if (wait_proc && just_wait_proc)
{
- if (wait_proc->infd < 0) /* Terminated */
+ if (wait_proc->infd < 0) /* Terminated. */
break;
FD_SET (wait_proc->infd, &Available);
check_delay = 0;
}
else
{
- /* Check this specific channel. */
+ /* Check this specific channel. */
if (wait_proc->gnutls_p /* Check for valid process. */
&& wait_proc->gnutls_state
/* Do we have pending data? */
xerrno = errno;
- /* Make C-g and alarm signals set flags again */
+ /* Make C-g and alarm signals set flags again. */
clear_waiting_for_input ();
/* If we woke up due to SIGWINCH, actually change size now. */
report_file_errno ("Failed select", Qnil, xerrno);
}
- /* Check for keyboard input */
+ /* Check for keyboard input. */
/* If there is any, return immediately
- to give it higher priority than subprocesses */
+ to give it higher priority than subprocesses. */
if (read_kbd != 0)
{
return Qt;
}
\f
-/* send a signal number SIGNO to PROCESS.
+/* Send a signal number SIGNO to PROCESS.
If CURRENT_GROUP is t, that means send to the process group
that currently owns the terminal being used to communicate with PROCESS.
This is used for various commands in shell mode.
Or perhaps this is vestigial. */
if (gid == -1)
no_pgrp = 1;
-#else /* ! defined (TIOCGPGRP ) */
+#else /* ! defined (TIOCGPGRP) */
/* Can't select pgrps on this system, so we know that
the child itself heads the pgrp. */
gid = p->pid;
-#endif /* ! defined (TIOCGPGRP ) */
+#endif /* ! defined (TIOCGPGRP) */
/* If current_group is lambda, and the shell owns the terminal,
don't send any signal. */
Lisp_Object tem = Fget_process (process);
if (NILP (tem))
{
- Lisp_Object process_number =
- string_to_number (SSDATA (process), 10, 1);
+ Lisp_Object process_number
+ = string_to_number (SSDATA (process), 10, 1);
if (INTEGERP (process_number) || FLOATP (process_number))
tem = process_number;
}
Inc.
** Malloc WARNING: This should never call malloc either directly or
- indirectly; if it does, that is a bug */
+ indirectly; if it does, that is a bug. */
static void
handle_child_signal (int sig)
#ifdef NS_IMPL_GNUSTEP
/* NSTask in GNUstep sets its child handler each time it is called.
So we must re-set ours. */
- catch_child_signal();
+ catch_child_signal ();
#endif
}
xerrno = errno;
- /* Make C-g and alarm signals set flags again */
+ /* Make C-g and alarm signals set flags again. */
clear_waiting_for_input ();
/* If we woke up due to SIGWINCH, actually change size now. */
report_file_errno ("Failed select", Qnil, xerrno);
}
- /* Check for keyboard input */
+ /* Check for keyboard input. */
if (read_kbd
&& detect_input_pending_run_timers (do_display))
void
add_keyboard_wait_descriptor (int desc)
{
-#ifdef subprocesses /* actually means "not MSDOS" */
+#ifdef subprocesses /* Actually means "not MSDOS". */
FD_SET (desc, &input_wait_mask);
FD_SET (desc, &non_process_wait_mask);
if (desc > max_input_desc)
}
/* Kill all processes associated with `buffer'.
- If `buffer' is nil, kill all processes */
+ If `buffer' is nil, kill all processes. */
void
kill_buffer_processes (Lisp_Object buffer)