From 7bc51bf8476e4546efaf28b90399e8a0280ac71f Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Sat, 1 Oct 2011 00:41:04 +0300 Subject: Use AC_SEARCH_LIBS for libdl ... instead of just substituting -ldl into LDFLAGS. The GNU linker's command line arguments are positional and this makes sure -ldl appears in right place. Fixes build problem on Ubuntu 11.10. diff --git a/configure.in b/configure.in index d17fc25..43d737f 100644 --- a/configure.in +++ b/configure.in @@ -83,11 +83,10 @@ AC_CHECK_FUNC(regcomp,AC_DEFINE(USE_REGEXP)) AC_CHECK_FUNC(lrand48,,AC_DEFINE(USE_RANDOM)) # Dynamic modules -dl_ldflags= +AC_SEARCH_LIBS(dlopen,[dl],[ + AC_DEFINE(HAVE_LIBDL) + dl_ldflags="-rdynamic"]) AC_SUBST(dl_ldflags) -AC_CHECK_LIB(dl,dlopen, - AC_DEFINE(HAVE_LIBDL) - AC_SUBST(dl_ldflags,"-rdynamic -ldl")) # Checks for header files. AC_CHECK_HEADERS([stdlib.h unistd.h]) -- cgit v0.10.2 From c65c95bf203ecd80923b5581f97db980d08ab807 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Mon, 25 Mar 2013 12:47:10 +0100 Subject: Enable TCP keep-alive diff --git a/tcp.c b/tcp.c index f4af987..2cca739 100644 --- a/tcp.c +++ b/tcp.c @@ -226,6 +226,10 @@ int tcp_connect __P2 (char *,addr, int,port) if (setsockopt(newtcp_fd, SOL_TCP, TCP_NODELAY, &opt, sizeof(opt))) errmsg("setsockopt(TCP_NODELAY) failed"); + /* TCP keep-alive */ + if (setsockopt(newtcp_fd, SOL_SOCKET, SO_KEEPALIVE, &opt, sizeof(opt))) + errmsg("setsockopt(SO_KEEPALIVE) failed"); + /* * Then, close-on-exec: * we don't want children to inherit the socket! -- cgit v0.10.2 From 8cf5b95b4405d4f6a14e1c2b75414b4c050669b0 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Wed, 10 Jul 2013 18:23:30 +0200 Subject: wrap_print: Fix an endless loop with 0-length strings diff --git a/utils.c b/utils.c index 58478c7..1b2013a 100644 --- a/utils.c +++ b/utils.c @@ -519,7 +519,7 @@ static void wrap_print __P1 (char *,s) ansibug = 1; #endif - while (l >= cols_1 - col0) { + while (l >= cols_1 - col0 && *s) { p = buf; m = 0; state = NORM; lp = ls = NULL; -- cgit v0.10.2 From b4be52e83452f530bee54c4889363f3da8317607 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Wed, 10 Jul 2013 21:25:22 +0200 Subject: README: Update the link to MUME diff --git a/README b/README index 4c80dd9..bba481e 100644 --- a/README +++ b/README @@ -142,7 +142,7 @@ AUTHORS OF POWWOW If you forgot where you downloaded powwow from, you can get it from the above address. - To learn more about MUME, have a look at http://fire.pvv.org/mume/ + To learn more about MUME, have a look at http://www.mume.org which also explains how to connect. COPYRIGHT -- cgit v0.10.2 From df6528300807a0d82870c5c27d411b7a93ee71a6 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Wed, 10 Jul 2013 21:58:58 +0200 Subject: build: Error out if curses libraries weren't found diff --git a/configure.in b/configure.in index 43d737f..c55310c 100644 --- a/configure.in +++ b/configure.in @@ -78,10 +78,16 @@ AC_PROG_CC AC_PROG_LN_S # Checks for libraries. -AC_SEARCH_LIBS(initscr,[ncurses curses]) AC_CHECK_FUNC(regcomp,AC_DEFINE(USE_REGEXP)) AC_CHECK_FUNC(lrand48,,AC_DEFINE(USE_RANDOM)) +if test "x${enable_vt100}" != "xyes"; then + AC_SEARCH_LIBS(initscr,[ncurses curses], [], [ + if test "x${enable_vt100}" = "xno" ; then + AC_MSG_ERROR([*** curses libraries not found]) + fi]) +fi + # Dynamic modules AC_SEARCH_LIBS(dlopen,[dl],[ AC_DEFINE(HAVE_LIBDL) -- cgit v0.10.2 From 2676fae2cf3a00368f311d52f3941b62005aee72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20H=C3=A5llberg?= Date: Sat, 13 Jul 2013 21:50:40 +0200 Subject: stop using bzero() and check a few return values diff --git a/cmd.c b/cmd.c index edd6d00..551a069 100644 --- a/cmd.c +++ b/cmd.c @@ -339,7 +339,7 @@ static void cmd_module __P1 (char *,arg) { /* I changed it to work this way so that you can have libs in multiple places and * also eventually to allow it to use .dll instead of .so under the cygwin environment */ for( pindex = 0; pindex < 5; pindex++ ) { - bzero( libname, 1024 ); + memset( libname, 0, sizeof libname ); /* don't look for name without .so, it breaks if you have a file * with the same name in the current dir and making it .so for sure @@ -574,9 +574,11 @@ static void cmd_shell __P1 (char *,arg) } } else { tty_quit(); - - system(arg); - + + if (system(arg) == -1) { + perror("system()"); + } + tty_start(); tty_gotoxy(col0 = 0, line0 = lines -1); tty_puts(tty_clreoln); diff --git a/configure.in b/configure.in index c55310c..762275e 100644 --- a/configure.in +++ b/configure.in @@ -112,7 +112,6 @@ AC_C_CONST # Checks for library functions. AC_FUNC_MALLOC -AC_CHECK_FUNCS([bzero]) AC_OUTPUT(Makefile) diff --git a/powwow-muc.c b/powwow-muc.c index c98547e..4f8ae18 100644 --- a/powwow-muc.c +++ b/powwow-muc.c @@ -82,8 +82,8 @@ int main( int argc, char *argv[] ) { timeout( 0 ); looping = 1; while( looping ) { - bzero( line, 1000 ); - fgets( line, 1000, in ); + memset( line, 0, sizeof line ); + fgets( line, sizeof line, in ); /* get file pos */ new_pos = curr_pos = ftell( in ); @@ -284,7 +284,7 @@ int main( int argc, char *argv[] ) { /* read to next newline so we don't break up lines seeking around */ - fgets( line, 1000, in ); + fgets( line, sizeof line, in ); new_pos = ftell( in ); /* Make a note of moving */ -- cgit v0.10.2