Commit 52f1626b authored by Niels Möller's avatar Niels Möller
Browse files

* Refer to a function foo as "foo", not "foo()", in messages and

comments. (GNU coding standard).

Rev: src/bignum.c:1.19
Rev: src/channel.c:1.93
Rev: src/channel_commands.c:1.23
Rev: src/client.c:1.106
Rev: src/client_keyexchange.c:1.57
Rev: src/client_userauth.c:1.46
Rev: src/connection.c:1.62
Rev: src/daemon.c:1.7
Rev: src/dh_exchange.c:1.12
Rev: src/gateway_channel.c:1.8
Rev: src/gateway_commands.c:1.8
Rev: src/gc.c:1.15
Rev: src/io.c:1.126
Rev: src/io_commands.c:1.36
Rev: src/jpoll.c:1.7
Rev: src/lsh_proxy.c:1.21
Rev: src/proxy_channel.c:1.5
Rev: src/proxy_session.c:1.9
Rev: src/proxy_tcpforward.c:1.6
Rev: src/proxy_userauth.c:1.7
Rev: src/reaper.c:1.19
Rev: src/server_keyexchange.c:1.47
Rev: src/server_pty.c:1.19
Rev: src/server_session.c:1.58
Rev: src/server_userauth.c:1.31
Rev: src/sexp.c:1.35
Rev: src/sexp_streamed_parser.c:1.29
Rev: src/spki_commands.c:1.18
Rev: src/tcpforward.c:1.60
Rev: src/tcpforward_commands.c:1.29
Rev: src/translate_signal.c:1.3
Rev: src/unix_interact.c:1.4
Rev: src/unix_random.c:1.8
Rev: src/unix_user.c:1.32
Rev: src/werror.c:1.50
Rev: src/zlib.c:1.30
parent 0a0c6421
......@@ -190,7 +190,7 @@ bignum_format_u_length(const mpz_t n)
case 1:
return (mpz_sizeinbase(n, 2) + 7) / 8;
default:
fatal("Internal error: Negative number to bignum_format_u_length()\n");
fatal("Internal error: Negative number to bignum_format_u_length\n");
}
}
......@@ -215,7 +215,7 @@ bignum_format_u(const mpz_t n, UINT8 *data)
return length;
}
default:
fatal("Internal error: Negative number to bignum_format_u()\n");
fatal("Internal error: Negative number to bignum_format_u\n");
}
}
......
......@@ -1689,7 +1689,7 @@ void init_connection_service(struct ssh_connection *connection)
{
struct channel_table *table = make_channel_table();
debug("channel.c: do_connection_service()\n");
debug("channel.c: do_connection_service\n");
connection->table = table;
......@@ -1853,7 +1853,7 @@ channel_transmit_extended(struct ssh_channel *channel,
/* NOTE: Flow control when sending data on a channel works as follows:
* When the i/o backend wants to read from one of the channel's
* sources, it first calls do_read_data_query() (in read_data.c),
* sources, it first calls do_read_data_query (in read_data.c),
* which looks at the current value of send_window_size to determine
* how much data can be sent right now. The backend reads at most that
* amount of data, and then calls do_channel_write or
......@@ -2072,7 +2072,7 @@ make_channel_io_exception_handler(struct ssh_channel *channel,
return &self->super;
}
/* Used by do_gateway_channel_open() */
/* Used by do_gateway_channel_open */
struct lsh_string *
format_channel_open_s(struct lsh_string *type,
UINT32 local_channel_number,
......
......@@ -52,7 +52,7 @@ do_channel_open_command(struct command *s,
if (index < 0)
{
/* We have run out of channel numbers. */
werror("do_channel_open_command: alloc_channel() failed\n");
werror("do_channel_open_command: alloc_channel failed\n");
EXCEPTION_RAISE(e,
make_channel_open_exception(
SSH_OPEN_RESOURCE_SHORTAGE,
......
......@@ -564,7 +564,7 @@ client_shell_session(struct client_options *options)
get_pty = make_pty_request(options->tty);
if (!get_pty)
{
werror("lsh: Can't use tty (probably getattr or atexit() failed.\n");
werror("lsh: Can't use tty (probably getattr or atexit failed).\n");
}
}
else
......
......@@ -71,7 +71,7 @@ do_handle_dh_reply(struct packet_handler *c,
struct verifier *v;
int res;
trace("handle_dh_reply()\n");
trace("handle_dh_reply\n");
server_key = dh_process_server_msg(&closure->dh, &signature, packet);
lsh_string_free(packet);
......
......@@ -153,7 +153,7 @@ make_client_userauth_state(struct client_userauth *userauth,
{
NEW(client_userauth_state, self);
trace("client_userauth.c: make_client_userauth_state()\n");
trace("client_userauth.c: make_client_userauth_state\n");
self->connection = connection;
self->userauth = userauth;
self->failure = NULL;
......@@ -534,7 +534,7 @@ send_password(struct client_password_state *state)
/* Password empty? */
if (!passwd->length)
{
/* NOTE: At least on some systems, the getpass() function
/* NOTE: At least on some systems, the getpass function
* sets the tty to raw mode, disabling ^C, ^D and the like.
*
* To be a little friendlier, we stop asking if the users
......@@ -553,7 +553,7 @@ send_password(struct client_password_state *state)
{
/* If the user aborts the password dialogue (by pressing ^D at
* the terminal, or by closing a password popup window,
* whatever), read_password() should return NULL, and we should
* whatever), read_password should return NULL, and we should
* skip to the next authentication method. */
static const struct exception no_passwd =
STATIC_EXCEPTION(EXC_USERAUTH, "No password supplied.");
......
......@@ -222,7 +222,7 @@ do_exc_connection_handler(struct exception_handler *s,
* the peer sends us more data.
*
* So any code that raises EXC_PAUSE_START_CONNECTION should
* also call connection_handle_pending() at a safe place. We
* also call connection_handle_pending at a safe place. We
* can't call it here, as we may be in the middle of the
* handling of a packet. Installing a callout would be best. */
......
......@@ -132,7 +132,7 @@ int daemon_pidfile(const char *name)
if (length < 0)
{
werror("Pid file '%z' already exists, but read() failed (errno = %i): %z\n",
werror("Pid file '%z' already exists, but read failed (errno = %i): %z\n",
name, errno, STRERROR(errno));
return 0;
}
......@@ -329,7 +329,7 @@ int daemon_init(void)
*/
if (setsid() < 0)
fatal("daemon_init: setsid() failed.\n");
fatal("daemon_init: setsid failed.\n");
/* This should not be needed. All potential tty:s should be
* opened with O_NOCTTY. FIXME: What if a user links, say,
......
......@@ -50,7 +50,7 @@ init_dh_instance(struct dh_method *m,
self->hash = MAKE_HASH(m->H);
self->exchange_hash = NULL;
debug("init_dh_instance()\n"
debug("init_dh_instance\n"
" V_C: %pS\n", c->versions[CONNECTION_CLIENT]);
debug(" V_S: %pS\n", c->versions[CONNECTION_SERVER]);
debug(" I_C: %xS\n", c->literal_kexinits[CONNECTION_CLIENT]);
......
......@@ -112,7 +112,7 @@ gateway_init_io(struct gateway_channel *channel)
/* NOTE: We don't initialize the rec_window_size and rec_max_packet fields here.
*
* The origin's rec_window_size and rec_max_packet are filled in
* later, by do_gateway_channel_open_continuation(). The target's
* later, by do_gateway_channel_open_continuation. The target's
* rec_window_size, on the other hand, must be filled in manually. */
struct gateway_channel *
......
......@@ -40,7 +40,7 @@
#include "gateway_commands.c.x"
/* A simplified version of do_pad() in pad.c. This one uses
/* A simplified version of do_pad in pad.c. This one uses
* a fixed block size and pads with zeros. */
/* FIXME: It seems very unnecessary to pad at all; we could just use
......@@ -112,7 +112,7 @@ gateway_make_connection(struct listen_value *lv,
NULL, /* established_continuation */
make_exc_finish_read_handler(lv->fd, e, HANDLER_CONTEXT));
/* Instead of calling connection_init_io(). */
/* Instead of calling connection_init_io. */
connection->raw =
&io_read_write(lv->fd,
make_buffered_read(
......
......@@ -158,7 +158,7 @@ void gc_register(struct lsh_object *o)
/* NOTE: If the object is close to the start of the object list, it is
* deallocated and forgotten immedietely. If the object is not found,
* we don't search the entire list, but instead defer deallocation to
* gc_sweep(). */
* gc_sweep. */
void gc_kill(struct lsh_object *o)
{
sanity_check_object_list();
......@@ -194,7 +194,7 @@ void gc_kill(struct lsh_object *o)
else
{
#if 0
debug("gc_kill: Deferring deallocation to gc_sweep()\n");
debug("gc_kill: Deferring deallocation to gc_sweep\n");
#endif
}
......
......@@ -180,7 +180,7 @@ int io_iter(struct io_backend *b)
*
* FIXME: How can we improve this? We could keep a stack of closed
* files, but that will require backpointers from the fd:s to the
* backend (so that kill_fd() can find the top of the stack). */
* backend (so that kill_fd can find the top of the stack). */
do
{
......@@ -212,7 +212,7 @@ int io_iter(struct io_backend *b)
if (close(fd->fd) < 0)
{
werror("io.c: close() failed, (errno = %i): %z\n",
werror("io.c: close failed, (errno = %i): %z\n",
errno, STRERROR(errno));
EXCEPTION_RAISE(fd->e,
make_io_exception(EXC_IO_CLOSE, fd,
......@@ -318,8 +318,8 @@ int io_iter(struct io_backend *b)
if (!fd->super.alive)
continue;
/* On systems without poll(), we use jpoll.c to emulate some
* of poll(), but we lack POLLNVAL, POLLPRI and POLLHUP. */
/* On systems without poll, we use jpoll.c to emulate some
* of poll, but we lack POLLNVAL, POLLPRI and POLLHUP. */
#ifdef POLLNVAL
if (fds[i].revents & POLLNVAL)
{
......@@ -332,7 +332,7 @@ int io_iter(struct io_backend *b)
#endif /* POLLNVAL */
#ifdef POLLHUP
/* NOTE: The behaviour of poll() at EOF varies quite a lot
/* NOTE: The behaviour of poll at EOF varies quite a lot
* between systems.
*
* According to Solaris' man page, POLLHUP is mutually
......@@ -341,10 +341,10 @@ int io_iter(struct io_backend *b)
* However, on my system (sparc-linux) POLLHUP is set when we
* get EOF on an fd we are reading.
*
* I.e. on some systems, EOF is indicated by poll() setting
* POLLIN and read() returning 0 (in particular, this happens
* I.e. on some systems, EOF is indicated by poll setting
* POLLIN and read returning 0 (in particular, this happens
* if the poll-by-select-code in jpoll.c is used), while on
* other systems, poll() sets POLLHUP and subsequent read()
* other systems, poll sets POLLHUP and subsequent read
* calls will return -1, not 0.
*
* But to complicate things some more, we can (also on Linux)
......@@ -352,7 +352,7 @@ int io_iter(struct io_backend *b)
* ordinary read.
*
* We set the hanged_up flag before calling FD_READ, which
* tells the io_callback that it should avoid calling read(). */
* tells the io_callback that it should avoid calling read. */
if (fds[i].revents & POLLHUP)
{
......@@ -481,7 +481,7 @@ do_buffered_read(struct io_callback *s,
assert(fd->want_read);
/* If hanged_up is set, pretend that read() returned 0 */
/* If hanged_up is set, pretend that read returned 0 */
res = fd->hanged_up ? 0 : read(fd->fd, buffer, self->buffer_size);
if (res < 0)
......@@ -493,7 +493,7 @@ do_buffered_read(struct io_callback *s,
werror("io.c: read_callback: Unexpected EWOULDBLOCK\n");
break;
case EPIPE:
/* Getting EPIPE from read() seems strange, but appearantly
/* Getting EPIPE from read seems strange, but appearantly
* it happens sometimes. */
werror("Unexpected EPIPE.\n");
default:
......@@ -511,7 +511,7 @@ do_buffered_read(struct io_callback *s,
UINT32 done;
/* FIXME: What to do if want_read is false? To improve the
* connection_lock() mechanism, it must be possible to
* connection_lock mechanism, it must be possible to
* temporarily stop reading, which means that fd->want_read
* has to be cleared.
*
......@@ -549,7 +549,7 @@ do_buffered_read(struct io_callback *s,
}
if (left)
verbose("read_buffered(): fd died, %i buffered bytes discarded\n",
verbose("read_buffered: fd died, %i buffered bytes discarded\n",
left);
}
else
......@@ -592,7 +592,7 @@ do_consuming_read(struct io_callback *c,
if (fd->hanged_up)
{
/* If hanged_up is set, pretend that read() returned 0 */
/* If hanged_up is set, pretend that read returned 0 */
goto eof;
}
......@@ -756,10 +756,10 @@ do_listen_callback(struct io_callback *s,
(struct sockaddr *) &peer, &addr_len);
if (conn < 0)
{
werror("io.c: accept() failed, %z", STRERROR(errno));
werror("io.c: accept failed, %z", STRERROR(errno));
return;
}
trace("io.c: accept() on fd %i\n", conn);
trace("io.c: accept on fd %i\n", conn);
COMMAND_RETURN(self->c,
make_listen_value(make_lsh_fd(self->backend,
conn, self->e),
......@@ -795,10 +795,10 @@ do_listen_callback_no_peer(struct io_callback *s,
(struct sockaddr *) &peer, &addr_len);
if (conn < 0)
{
werror("io.c: accept() failed, %z", STRERROR(errno));
werror("io.c: accept failed, %z", STRERROR(errno));
return;
}
trace("io.c: accept() on fd %i\n", conn);
trace("io.c: accept on fd %i\n", conn);
COMMAND_RETURN(self->c, make_lsh_fd(self->backend,
conn, self->e));
}
......@@ -841,7 +841,7 @@ do_connect_callback(struct io_callback *s,
{
debug("io.c: connect_callback: Connect failed.\n");
EXCEPTION_RAISE(fd->e,
make_io_exception(EXC_IO_CONNECT, fd, 0, "connect() failed."));
make_io_exception(EXC_IO_CONNECT, fd, 0, "connect failed."));
kill_fd(fd);
}
else
......@@ -924,7 +924,7 @@ init_file(struct io_backend *b, struct lsh_fd *f, int fd,
b->files = f;
}
/* These functions are used by werror() and friends */
/* These functions are used by werror and friends */
/* For fd:s in blocking mode. */
const struct exception *
......@@ -1138,7 +1138,7 @@ sockaddr2info(size_t addr_len UNUSED,
* connects. */
return NULL;
default:
werror("io.c: sockaddr2info(): Unsupported address family.\n");
werror("io.c: sockaddr2info: Unsupported address family.\n");
return NULL;
}
}
......@@ -1181,7 +1181,7 @@ address_info2sockaddr(socklen_t *length,
else
host = NULL;
/* Some systems have getaddrinfo(), but still doesn't implement all of
/* Some systems have getaddrinfo, but still doesn't implement all of
* RFC 2553 */
#if defined(HAVE_GETADDRINFO) && \
defined(HAVE_GAI_STRERROR) && defined(HAVE_AI_NUMERICHOST)
......@@ -1241,7 +1241,7 @@ address_info2sockaddr(socklen_t *length,
defined(HAVE_GAI_STRERROR) && defined(HAVE_AI_NUMERICHOST) */
#if WITH_IPV6
#error IPv6 enabled, but getaddrinfo() and friends were not found.
#error IPv6 enabled, but getaddrinfo and friends were not found.
#endif
if (a->ip && memchr(a->ip->data, ':', a->ip->length))
......@@ -1524,7 +1524,7 @@ safe_pushd(const char *directory,
/* Check that it has reasonable permissions */
if (stat(".", &sbuf) < 0)
{
werror("io.c: Failed to stat() \".\" (supposed to be %z).\n"
werror("io.c: Failed to stat \".\" (supposed to be %z).\n"
" (errno = %i): %z\n", directory, errno, STRERROR(errno));
safe_popd(old_cd, directory);
......@@ -1598,7 +1598,7 @@ io_listen_local(struct io_backend *b,
}
/* We have to change the umask, as that's the only way to control
* the permissions that bind() uses. */
* the permissions that bind uses. */
old_umask = umask(0077);
......@@ -1878,7 +1878,7 @@ make_io_exception(UINT32 type, struct lsh_fd *fd, int error, const char *msg)
#else /* !linux */
/* Don't know how to work around the broken shutdown(). So disable it
/* Don't know how to work around the broken shutdown. So disable it
* completely. */
#define SHUTDOWN(fd, how) 0
......@@ -1904,13 +1904,13 @@ make_io_exception(UINT32 type, struct lsh_fd *fd, int error, const char *msg)
/* Creates a one-way socket connection. Returns 1 on success, 0 on
* failure. fds[0] is for reading, fds[1] for writing (like for the
* pipe() system call). */
* pipe system call). */
int
lsh_make_pipe(int *fds)
{
if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0)
{
werror("socketpair() failed: %z\n", STRERROR(errno));
werror("socketpair failed: %z\n", STRERROR(errno));
return 0;
}
debug("Created socket pair. Using fd:s %i <-- %i\n", fds[0], fds[1]);
......
......@@ -32,7 +32,7 @@
#include <assert.h>
/* Needed only to get the error code from failed calls to io_connect() */
/* Needed only to get the error code from failed calls to io_connect */
#include <errno.h>
/* For STDIN_FILENO */
......@@ -161,9 +161,9 @@ do_listen(struct io_backend *backend,
struct address_info *a,
int lookup,
struct resource_list *resources,
/* Continuation if listen() succeeds. */
/* Continuation if listen succeeds. */
struct command_continuation *listen_c,
/* Continuation if accept() succeeds. */
/* Continuation if accept succeeds. */
struct command_continuation *accept_c,
struct exception_handler *e)
{
......@@ -319,7 +319,7 @@ do_connect(struct io_backend *backend,
}
/* If the name is canonicalized in any way, we should pass the
* canonical name to make_connect_continuation() .*/
* canonical name to make_connect_continuation .*/
fd = io_connect(backend, addr, addr_length,
make_connect_continuation(a, c), e);
lsh_space_free(addr);
......
/* jpoll.c
*
* This code emulates a minimal poll() function, and can be used as a drop-in
* This code emulates a minimal poll function, and can be used as a drop-in
* replacement for the SVID3 implementation. Note that at this time it only
* emulates the POLLIN and POLLOUT events.
*
......
......@@ -467,7 +467,7 @@ do_proxy_destination(struct command *s,
else
{
struct exception *ex =
make_io_exception(EXC_IO, client_addr->fd, errno, "getsockname() failed");
make_io_exception(EXC_IO, client_addr->fd, errno, "getsockname failed");
EXCEPTION_RAISE(e, ex);
}
......
......@@ -93,7 +93,7 @@ do_init_io(struct proxy_channel *self)
/* NOTE: It seems most calls doesn't provide the correct value for
* rec_max_packet. In these cases, it should probably be filled in
* later, by do_proxy_channel_open_continuation() fill it in later. */
* later, by do_proxy_channel_open_continuation fill it in later. */
struct proxy_channel *
make_proxy_channel(UINT32 window_size,
UINT32 rec_max_packet,
......
......@@ -57,7 +57,7 @@ do_proxy_open_session(struct channel_open *s,
{
CAST(proxy_open_session, closure, s);
debug("server.c: do_proxy_open_session()\n");
debug("server.c: do_proxy_open_session\n");
if (parse_eod(args))
{
......
......@@ -43,7 +43,7 @@ do_proxy_open_direct_tcpip(struct channel_open *s UNUSED,
struct lsh_string *host = NULL, *orig_host = NULL;
UINT32 port, orig_port;
debug("server.c: do_proxy_open_direct_tcpip()\n");
debug("server.c: do_proxy_open_direct_tcpip\n");
if ((host = parse_string_copy(args)) &&
parse_uint32(args, &port) &&
......@@ -99,7 +99,7 @@ do_proxy_open_forwarded_tcpip(struct channel_open *s UNUSED,
struct lsh_string *host = NULL, *orig_host = NULL;
UINT32 port, orig_port;
debug("server.c: do_proxy_open_forwarded_tcpip()\n");
debug("server.c: do_proxy_open_forwarded_tcpip\n");
if ((host = parse_string_copy(args)) &&
parse_uint32(args, &port) &&
......
......@@ -295,7 +295,7 @@ do_proxy_userauth_continuation(struct command_continuation *c,
FORCE_APPLY(action, self->super.up, self->super.e);
/* FIXME: Possibly call connection_handle_pending(). */
/* FIXME: Possibly call connection_handle_pending. */
}
static struct command_continuation *
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment