From 025545aee3dce3517e83e2c74684e3fe0d2408c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ondrej=20Kuzn=EDk?= Date: Sat, 28 Sep 2013 20:49:46 +0200 Subject: [PATCH] Fix typos and type warnings --- common.c | 8 ++++---- sslh-main.c | 2 +- sslh-select.c | 2 +- t | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common.c b/common.c index 8e4d0be..ab67cd7 100644 --- a/common.c +++ b/common.c @@ -230,7 +230,7 @@ void dump_connection(struct connection *cnx) /* * moves data from one fd to other * - * retuns number of bytes copied if success + * returns number of bytes copied if success * returns 0 (FD_CNXCLOSED) if incoming socket closed * returns FD_NODATA if no data was available * returns FD_STALLED if data was read, could not be written, and has been @@ -265,7 +265,7 @@ int fd2fd(struct queue *target_q, struct queue *from_q) size_w = write(target, buffer, size_r); /* process -1 when we know how to deal with it */ - if ((size_w == -1)) { + if (size_w == -1) { switch (errno) { case EAGAIN: /* write blocked: Defer data */ @@ -479,7 +479,7 @@ void setup_signals(void) res = sigaction(SIGCHLD, &action, NULL); CHECK_RES_DIE(res, "sigaction"); - /* Set SIGTERM to exit. For some reason if it's not set explicitely, + /* Set SIGTERM to exit. For some reason if it's not set explicitly, * coverage information is lost when killing the process */ memset(&action, 0, sizeof(action)); action.sa_handler = exit; @@ -509,7 +509,7 @@ void setup_syslog(const char* bin_name) { log_message(LOG_INFO, "%s %s started\n", server_type, VERSION); } -/* We don't want to run as root -- drop priviledges if required */ +/* We don't want to run as root -- drop privileges if required */ void drop_privileges(const char* user_name) { int res; diff --git a/sslh-main.c b/sslh-main.c index a522b1a..d483f00 100644 --- a/sslh-main.c +++ b/sslh-main.c @@ -275,7 +275,7 @@ static int config_parse(char *filename, struct addrinfo **listen, struct proto * config_lookup_bool(&config, "numeric", &numeric); config_lookup_bool(&config, "transparent", &transparent); - if (config_lookup_int(&config, "timeout", &timeout) == CONFIG_TRUE) { + if (config_lookup_int(&config, "timeout", (int *)&timeout) == CONFIG_TRUE) { probing_timeout = timeout; } diff --git a/sslh-select.c b/sslh-select.c index 6c696eb..db05645 100644 --- a/sslh-select.c +++ b/sslh-select.c @@ -188,7 +188,7 @@ int is_fd_active(int fd, fd_set* set) } /* Main loop: the idea is as follow: - * - fds_r and fds_w contain the file descritors to monitor in read and write + * - fds_r and fds_w contain the file descriptors to monitor in read and write * - When a file descriptor goes off, process it: read from it, write the data * to its corresponding pair. * - When a file descriptor blocks when writing, remove the read fd from fds_r, diff --git a/t b/t index ed2e26d..7bef47d 100755 --- a/t +++ b/t @@ -58,7 +58,7 @@ for my $binary (@binaries) { my $cmd = "./$binary -v -f -u $user --listen localhost:$sslh_port --ssh $ssh_address --ssl $ssl_address -P $pidfile"; warn "$cmd\n"; #exec $cmd; - exec "valgrind --leak-check=full ./sslh-select -v -f -u $user --listen localhost:$sslh_port --ssh $ssh_address -ssl $ssl_address -P $pidfile"; + exec "valgrind --leak-check=full ./$binary -v -f -u $user --listen localhost:$sslh_port --ssh $ssh_address -ssl $ssl_address -P $pidfile"; exit 0; } warn "spawned $sslh_pid\n";