From 728aa916c59aab5d1e6a1f1fc82e4cdf46466dad Mon Sep 17 00:00:00 2001 From: Pavel Lishin Date: Sun, 31 May 2015 14:12:54 -0400 Subject: [PATCH 1/3] Improving install instructions: adding autoconf instructions, git ignoring autoconf output --- .gitignore | 23 +++++++++++++++++++++++ INSTALL | 16 ++++++++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..16671a8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +# Automake-generated files +Makefile +Makefile.in +aclocal.m4 +autom4te.cache +compile +config.log +config.status +configure +depcomp +install-sh +missing +src/.deps/ +src/.dirstamp +src/conf.c +src/conf.h +src/conf.o +src/config.h +src/config.h.in +src/lex.c +src/lex.o +src/stamp-h1 +ylwrap diff --git a/INSTALL b/INSTALL index b42a17a..68b5133 100644 --- a/INSTALL +++ b/INSTALL @@ -26,8 +26,11 @@ it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type + `aclocal && autoheader && autoreconf --install' to generate the + configure file. + + 2. Type `./configure' to configure the package for your system. If + you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. @@ -39,6 +42,15 @@ The simplest way to compile this package is: 3. Optionally, type `make check' to run any self-tests that come with the package. + (If you get an error that looks like this: + + src/connection.c: In function 'tmp_dh_cb': + src/connection.c:1121:22: error: unused parameter 'ssl_unused' [-Werror=unused-parameter] + cc1: all warnings being treated as errors + make[1]: *** [src/connection.o] Error 1 + + install autoconf-archive.) + 4. Type `make install' to install the programs and any data files and documentation. -- 2.4.2 From a33367e02ea2b718cce5d9442cf71ee997e81c62 Mon Sep 17 00:00:00 2001 From: Pavel Lishin Date: Mon, 1 Jun 2015 11:58:32 -0400 Subject: [PATCH 2/3] Ignoring built files --- .gitignore | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 16671a8..e83b68f 100644 --- a/.gitignore +++ b/.gitignore @@ -14,10 +14,15 @@ src/.deps/ src/.dirstamp src/conf.c src/conf.h -src/conf.o src/config.h src/config.h.in src/lex.c -src/lex.o src/stamp-h1 ylwrap + +# Generated object files +src/*.o + +# Generated binaries +src/bip +src/bipmkpw \ No newline at end of file -- 2.4.2 From f1aeeab065543f27e83b8374a69ea22affa1f6ad Mon Sep 17 00:00:00 2001 From: Pavel Lishin Date: Mon, 1 Jun 2015 11:58:59 -0400 Subject: [PATCH 3/3] Letting compiler know which variables are meant to be unused; making sure ret is defined before using. --- src/bip.c | 2 +- src/bipmkpw.c | 6 +++--- src/irc.c | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/bip.c b/src/bip.c index 73a401c..3a97db7 100644 --- a/src/bip.c +++ b/src/bip.c @@ -1312,7 +1312,7 @@ int main(int argc, char **argv) else pid = getpid(); snprintf(buf, 29, "%ld\n", (long unsigned int)pid); - write(fd, buf, strlen(buf)); + UNUSED(int bytes_written) = write(fd, buf, strlen(buf)); close(fd); bip.listener = listen_new(conf_ip, conf_port, conf_css); diff --git a/src/bipmkpw.c b/src/bipmkpw.c index cc2d5ff..9765183 100644 --- a/src/bipmkpw.c +++ b/src/bipmkpw.c @@ -48,12 +48,12 @@ void readpass(char *buffer, int buflen) exit(1); } - write(ttyfd, "Password: ", 10); + UNUSED(int bytes_written) = write(ttyfd, "Password: ", 10); int idx = 0; int valid = 1; while (idx < buflen) { - read(ttyfd, buffer+idx, 1); + UNUSED(int bytes_read) = read(ttyfd, buffer+idx, 1); if (buffer[idx] == '\n') { buffer[idx] = 0; break; @@ -63,7 +63,7 @@ void readpass(char *buffer, int buflen) idx++; } - write(ttyfd, "\n", 1); + bytes_written = write(ttyfd, "\n", 1); tcsetattr(ttyfd, TCSANOW, &ttback); close(ttyfd); diff --git a/src/irc.c b/src/irc.c index 64df71e..eb6dc0d 100644 --- a/src/irc.c +++ b/src/irc.c @@ -1658,10 +1658,11 @@ static int irc_mode(struct link_server *server, struct line *line) ret = irc_mode_channel(server, channel, line, mode, add, cur_arg); } + + if (ret == ERR_PROTOCOL) + return ret; } } - if (ret == ERR_PROTOCOL) - return ret; } return OK_COPY; } -- 2.4.2