From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- .../unixtop-3.8_beta1-high-threadid-crash.patch | 75 ++++++++++++++++++++++ .../files/unixtop-3.8_beta1-memleak-fix-v2.patch | 44 +++++++++++++ .../unixtop/files/unixtop-3.8_beta1-ncurses.patch | 14 ++++ .../files/unixtop-3.8_beta1-no-AX-macros.patch | 22 +++++++ .../files/unixtop-3.8_beta1-percent-cpu.patch | 23 +++++++ .../files/unixtop-3.8_beta1-renice-segfault.patch | 21 ++++++ 6 files changed, 199 insertions(+) create mode 100644 sys-process/unixtop/files/unixtop-3.8_beta1-high-threadid-crash.patch create mode 100644 sys-process/unixtop/files/unixtop-3.8_beta1-memleak-fix-v2.patch create mode 100644 sys-process/unixtop/files/unixtop-3.8_beta1-ncurses.patch create mode 100644 sys-process/unixtop/files/unixtop-3.8_beta1-no-AX-macros.patch create mode 100644 sys-process/unixtop/files/unixtop-3.8_beta1-percent-cpu.patch create mode 100644 sys-process/unixtop/files/unixtop-3.8_beta1-renice-segfault.patch (limited to 'sys-process/unixtop/files') diff --git a/sys-process/unixtop/files/unixtop-3.8_beta1-high-threadid-crash.patch b/sys-process/unixtop/files/unixtop-3.8_beta1-high-threadid-crash.patch new file mode 100644 index 000000000000..734826a647dd --- /dev/null +++ b/sys-process/unixtop/files/unixtop-3.8_beta1-high-threadid-crash.patch @@ -0,0 +1,75 @@ +https://sourceforge.net/tracker/index.php?func=detail&aid=2815842&group_id=72892&atid=536042 + +*** hash.c-old Thu Jul 2 15:30:55 2009 +--- hash.c Thu Jul 2 15:48:39 2009 +*************** +*** 1354,1360 **** + hi->value = value; + + /* hash to the bucket */ +! bucket = &(ht->buckets[((key.k_thr * 10000 + key.k_pid) % ht->num_buckets)]); + + /* walk the list to make sure we do not have a duplicate */ + ll = &(bucket->list); +--- 1354,1360 ---- + hi->value = value; + + /* hash to the bucket */ +! bucket = &(ht->buckets[(((unsigned long)(key.k_thr) * 10000U + (unsigned long)(key.k_pid)) % ht->num_buckets)]); + + /* walk the list to make sure we do not have a duplicate */ + ll = &(bucket->list); +*************** +*** 1408,1414 **** + pidthr_t k1; + + /* find the bucket */ +! bucket = &(ht->buckets[((key.k_thr * 10000 + key.k_pid) % ht->num_buckets)]); + + /* walk the list until we find the existing item */ + ll = &(bucket->list); +--- 1408,1414 ---- + pidthr_t k1; + + /* find the bucket */ +! bucket = &(ht->buckets[(((unsigned long)(key.k_thr) * 10000U + (unsigned long)(key.k_pid)) % ht->num_buckets)]); + + /* walk the list until we find the existing item */ + ll = &(bucket->list); +*************** +*** 1460,1466 **** + pidthr_t k1; + + result = NULL; +! if ((bucket = &(ht->buckets[((key.k_thr * 10000 + key.k_pid) % ht->num_buckets)])) != NULL) + { + ll = &(bucket->list); + li = LL_FIRST(ll); +--- 1460,1466 ---- + pidthr_t k1; + + result = NULL; +! if ((bucket = &(ht->buckets[(((unsigned long)(key.k_thr) * 10000U + (unsigned long)(key.k_pid)) % ht->num_buckets)])) != NULL) + { + ll = &(bucket->list); + li = LL_FIRST(ll); +*************** +*** 1499,1505 **** + pidthr_t k1; + + result = NULL; +! if ((bucket = &(ht->buckets[((key.k_thr * 10000 + key.k_pid) % ht->num_buckets)])) != NULL) + { + ll = &(bucket->list); + li = LL_FIRST(ll); +--- 1499,1505 ---- + pidthr_t k1; + + result = NULL; +! if ((bucket = &(ht->buckets[(((unsigned long)(key.k_thr) * 10000U + (unsigned long)(key.k_pid)) % ht->num_buckets)])) != NULL) + { + ll = &(bucket->list); + li = LL_FIRST(ll); + + + diff --git a/sys-process/unixtop/files/unixtop-3.8_beta1-memleak-fix-v2.patch b/sys-process/unixtop/files/unixtop-3.8_beta1-memleak-fix-v2.patch new file mode 100644 index 000000000000..76042bb4c1a6 --- /dev/null +++ b/sys-process/unixtop/files/unixtop-3.8_beta1-memleak-fix-v2.patch @@ -0,0 +1,44 @@ +https://hg.openindiana.org/upstream/oracle/userland-gate/raw-file/23c55a2f8a8e/components/top/patches/03.sunos5.patch + +*** top-3.8beta1/machine/m_sunos5.c.orig Wed Aug 31 05:23:52 2011 +--- top-3.8beta1/machine/m_sunos5.c Wed Aug 31 05:25:25 2011 +*************** +*** 2064,2070 **** + + /* read the whole file */ + p = malloc(st.st_size); +! (void)pread(fd, p, st.st_size, 0); + + /* cache the file descriptor if we can */ + if (fd < maxfiles) +--- 2064,2076 ---- + + /* read the whole file */ + p = malloc(st.st_size); +! if (pread(fd, p, st.st_size, 0) != st.st_size) +! { +! (void) close(fd); +! op->fd_lpsinfo = -1; +! free(p); +! continue; +! } + + /* cache the file descriptor if we can */ + if (fd < maxfiles) +*************** +*** 2148,2154 **** + op->oldtime = TIMESPEC_TO_DOUBLE(lwpp->pr_time); + op->seen = 1; + } +! free(p); + } + #endif + +--- 2154,2160 ---- + op->oldtime = TIMESPEC_TO_DOUBLE(lwpp->pr_time); + op->seen = 1; + } +! free(prp); + } + #endif + diff --git a/sys-process/unixtop/files/unixtop-3.8_beta1-ncurses.patch b/sys-process/unixtop/files/unixtop-3.8_beta1-ncurses.patch new file mode 100644 index 000000000000..73cd88b72826 --- /dev/null +++ b/sys-process/unixtop/files/unixtop-3.8_beta1-ncurses.patch @@ -0,0 +1,14 @@ +* check ncurses first, such that we only link agains (system) termcap if + necessary (never the case in prefix) -- grobian@gentoo.org + +--- configure.ac ++++ configure.ac +@@ -174,7 +174,7 @@ + AC_CHECK_LIB(kvm, kvm_open) + # -lmld -lmach + AC_CHECK_LIB(mach, vm_statistics) +-AC_SEARCH_LIBS(tgetent, termcap curses ncurses) ++AC_SEARCH_LIBS(tgetent, ncurses curses termcap) + AC_CHECK_LIB(m, exp) + + # check for libraries required by extension diff --git a/sys-process/unixtop/files/unixtop-3.8_beta1-no-AX-macros.patch b/sys-process/unixtop/files/unixtop-3.8_beta1-no-AX-macros.patch new file mode 100644 index 000000000000..f5d34a4a9ae9 --- /dev/null +++ b/sys-process/unixtop/files/unixtop-3.8_beta1-no-AX-macros.patch @@ -0,0 +1,22 @@ +* no idea where these macros are, but we can surely do without this, for + now -- grobian@gentoo.org + +--- configure.ac ++++ configure.ac +@@ -504,16 +504,6 @@ + + AC_MSG_RESULT($result) + +-# add extra cflags if the compiler accepts them +-AX_CFLAGS_WARN_ALL +-MODULE_CFLAGS="" +-if test "$ax_cv_c_compiler_vendor" = "gnu"; then +- AX_CFLAGS_GCC_OPTION([-fno-strict-aliasing], [MODULE_CFLAGS]) +- if test "$target_cpu" = "alpha"; then +- AX_CFLAGS_GCC_OPTION([-mfp-trap-mode=sui -mtrap-precision=i]) +- fi +-fi +- + # Define man page supplement + MAN_SUPPLEMENT=machine/m_$MODULE.man + AC_SUBST_FILE(MAN_SUPPLEMENT) diff --git a/sys-process/unixtop/files/unixtop-3.8_beta1-percent-cpu.patch b/sys-process/unixtop/files/unixtop-3.8_beta1-percent-cpu.patch new file mode 100644 index 000000000000..503ed3576a70 --- /dev/null +++ b/sys-process/unixtop/files/unixtop-3.8_beta1-percent-cpu.patch @@ -0,0 +1,23 @@ +https://hg.openindiana.org/upstream/oracle/userland-gate/file/23c55a2f8a8e/components/top/patches/04.percent_cpu.patch + +--- top-3.8beta1/machine/m_sunos5.c.orig Tue Nov 8 11:23:08 2011 ++++ top-3.8beta1/machine/m_sunos5.c Tue Nov 8 11:23:11 2011 +@@ -152,8 +152,17 @@ + * one of the spare slots in the prinfo structure. + */ + +-#define percent_cpu(pp) (*(double *)dbl_align(&pp->pr_filler[0])) ++#if OSREV > 59 ++/* ++ * on Solaris 10, psinfo.pr_filler is 4 bytes and not double-aligned, so we must * move our scratch space to the larger pr.lwp_pr_filler which is 20 bytes ++ * XXX this is a time bomb and will likely break in future Solaris releases. ++ */ ++#define percent_cpu(pp) (*(double *)dbl_align(&pp->pr_lwp.pr_filler[0])) ++#else ++#define percent_cpu(pp) (*(double *)dbl_align(&pp->pr_filler[0])) ++#endif + ++ + /* definitions for indices in the nlist array */ + #define X_V 0 + #define X_MPID 1 diff --git a/sys-process/unixtop/files/unixtop-3.8_beta1-renice-segfault.patch b/sys-process/unixtop/files/unixtop-3.8_beta1-renice-segfault.patch new file mode 100644 index 000000000000..afea694b59ad --- /dev/null +++ b/sys-process/unixtop/files/unixtop-3.8_beta1-renice-segfault.patch @@ -0,0 +1,21 @@ +http://defect.opensolaris.org/bz/show_bug.cgi?id=6580 + +--- top-3.8beta1/commands.c ++++ top-3.8beta1/commands.c +@@ -501,13 +501,15 @@ + if (procnum == -1 || prio < PRIO_MIN || prio > PRIO_MAX) + { + message_error(" renice: bad priority value"); ++ return; + } + #endif + + /* move to the first process number */ + if ((str = next_field(str)) == NULL) + { +- message_error(" remice: no processes specified"); ++ message_error(" renice: no processes specified"); ++ return; + } + + #ifdef HAVE_SETPRIORITY -- cgit v1.2.3