components/mtr/patches/ncurses.patch
author Rich Burridge <rich.burridge@oracle.com>
Tue, 02 May 2017 17:33:26 -0700
changeset 7964 d9801318ed3d
parent 4045 c595d2a22c25
permissions -rw-r--r--
25981468 Build ilmbase and openexr with the GNU compilers

This has been filed upstream at:

    https://github.com/traviscross/mtr/issues/76

and fixed in

    https://github.com/traviscross/mtr/commit/effef18b359c78a968de28cb1090866e974bd34f
    https://github.com/traviscross/mtr/commit/0b782f6a31d999694554b670009698499e2c98cc

These changes should be available in mtr 0.87.

--- mtr-0.86/configure.ac	Tue Dec  9 03:20:57 2014
+++ mtr-0.86/configure.ac	Tue Mar 24 15:03:00 2015
@@ -20,20 +20,11 @@
 AC_CHECK_HEADERS(ncurses.h ncurses/curses.h curses.h cursesX.h sys/types.h fcntl.h)
 AC_CHECK_HEADERS(socket.h sys/socket.h sys/xti.h arpa/nameser_compat.h)
 
-# We don't refer to any symbols in termcap, but -lcurses on SunOS does.
-# We have to trust the linker not to mess things up... (It should not
-# pull in anything if we don't refer to anything in the lib). 
-AC_CHECK_LIB(termcap, tgetent)
-AC_CHECK_LIB(tinfo, tgetent)
+AC_SEARCH_LIBS(initscr, [ncurses curses cursesX], ,
+  AC_MSG_WARN(Building without curses display support)
+  AC_DEFINE(NO_CURSES, 1, [Define if you don't have the curses libraries available.])
+  CURSES_OBJ=)
 
-AC_CHECK_FUNC(initscr, , 
-  AC_CHECK_LIB(ncurses, initscr, , 
-    AC_CHECK_LIB(curses, initscr, , 
-      AC_CHECK_LIB(cursesX, initscr, , 
-	AC_MSG_WARN(Building without curses display support)
-	AC_DEFINE(NO_CURSES, 1, Define if you don't have the curses libraries available.)
-	CURSES_OBJ=))))
-
 AC_CHECK_FUNCS(attron fcntl)
 
 AC_CHECK_LIB(m, floor, , AC_MSG_ERROR(No math library found))
--- mtr-0.86/mtr.c	Tue Dec  9 03:20:57 2014
+++ mtr-0.86/mtr.c	Fri Mar 20 09:43:55 2015
@@ -89,7 +89,7 @@
 int   maxTTL = 30;              /* inline with traceroute */
                                 /* end ttl window stuff. */
 int remoteport = 80;            /* for TCP tracing */
-int timeout = 10 * 1000000;     /* for TCP tracing */
+int tcp_timeout = 10 * 1000000; /* for TCP tracing */
 
 
 /* default display field(defined by key in net.h) and order */
@@ -454,8 +454,8 @@
       }
       break;
     case 'Z':
-      timeout = atoi(optarg);
-      timeout *= 1000000;
+      tcp_timeout = atoi(optarg);
+      tcp_timeout *= 1000000;
       break;
     case '4':
       af = AF_INET;
--- mtr-0.86/net.c	Fri Mar 20 09:43:55 2015
+++ mtr-0.86/net.c	Fri Mar 20 09:43:55 2015
@@ -209,7 +209,7 @@
 extern int af;			/* address family of remote target */
 extern int mtrtype;		/* type of query packet used */
 extern int remoteport;          /* target port for TCP tracing */
-extern int timeout;             /* timeout for TCP connections */
+extern int tcp_timeout;		/* timeout for TCP connections */
 #ifdef SO_MARK
 extern int mark;		/* SO_MARK to set for ping packet*/
 #endif
@@ -1559,7 +1559,7 @@
     }
     if (fd > 0) {
       utime = sequence[at].time.tv_sec * 1000000L + sequence[at].time.tv_usec;
-      if (unow - utime > timeout) {
+      if (unow - utime > tcp_timeout) {
         close(fd);
         sequence[at].socket = 0;
       }