summaryrefslogtreecommitdiff
path: root/sys-process/unixtop/files/unixtop-3.8_beta1-high-threadid-crash.patch
diff options
context:
space:
mode:
Diffstat (limited to 'sys-process/unixtop/files/unixtop-3.8_beta1-high-threadid-crash.patch')
-rw-r--r--sys-process/unixtop/files/unixtop-3.8_beta1-high-threadid-crash.patch115
1 files changed, 40 insertions, 75 deletions
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
index 734826a647dd..00f19536e388 100644
--- 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
@@ -1,75 +1,40 @@
-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);
-
-
-
+https://sourceforge.net/p/unixtop/bugs/43/
+
+--- a/hash.c
++++ b/hash.c
+@@ -1354,7 +1354,7 @@ hash_add_pidthr(hash_table *ht, pidthr_t
+ hi->value = value;
+
+ /* hash to the bucket */
+- bucket = &(ht->buckets[((key.k_thr * 10000 + key.k_pid) % ht->num_buckets)]);
++ 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,7 +1408,7 @@ hash_replace_pidthr(hash_table *ht, pidt
+ pidthr_t k1;
+
+ /* find the bucket */
+- bucket = &(ht->buckets[((key.k_thr * 10000 + key.k_pid) % ht->num_buckets)]);
++ 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,7 +1460,7 @@ hash_lookup_pidthr(hash_table *ht, pidth
+ pidthr_t k1;
+
+ result = NULL;
+- if ((bucket = &(ht->buckets[((key.k_thr * 10000 + key.k_pid) % ht->num_buckets)])) != 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,7 +1499,7 @@ hash_remove_pidthr(hash_table *ht, pidth
+ pidthr_t k1;
+
+ result = NULL;
+- if ((bucket = &(ht->buckets[((key.k_thr * 10000 + key.k_pid) % ht->num_buckets)])) != 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);