[csw-devel] SF.net SVN: gar:[16239] csw/mgar/pkg/top/trunk

dmichelsen at users.sourceforge.net dmichelsen at users.sourceforge.net
Wed Nov 23 22:31:59 CET 2011


Revision: 16239
          http://gar.svn.sourceforge.net/gar/?rev=16239&view=rev
Author:   dmichelsen
Date:     2011-11-23 21:31:58 +0000 (Wed, 23 Nov 2011)
Log Message:
-----------
top/trunk: Apply missing patches

Modified Paths:
--------------
    csw/mgar/pkg/top/trunk/Makefile

Added Paths:
-----------
    csw/mgar/pkg/top/trunk/files/01.cmds.patch
    csw/mgar/pkg/top/trunk/files/02.hash-c.patch
    csw/mgar/pkg/top/trunk/files/03.sunos5.patch

Modified: csw/mgar/pkg/top/trunk/Makefile
===================================================================
--- csw/mgar/pkg/top/trunk/Makefile	2011-11-23 21:30:58 UTC (rev 16238)
+++ csw/mgar/pkg/top/trunk/Makefile	2011-11-23 21:31:58 UTC (rev 16239)
@@ -10,6 +10,14 @@
 MASTER_SITES = $(SF_MIRRORS)
 DISTFILES  = $(NAME)-$(VERSION).tar.gz
 
+# Location for browsing these patches is
+#   http://src.opensolaris.org/source/xref/userland/src/components/top/patches/
+# For safety they have also been put in files/
+MASTER_SITES += http://src.opensolaris.org/source/raw/userland/src/components/top/patches/
+PATCHFILES += 01.cmds.patch
+PATCHFILES += 02.hash-c.patch
+PATCHFILES += 03.sunos5.patch
+
 VENDOR_URL = http://www.unixtop.org/
 
 LICENSE = LICENSE

Added: csw/mgar/pkg/top/trunk/files/01.cmds.patch
===================================================================
--- csw/mgar/pkg/top/trunk/files/01.cmds.patch	                        (rev 0)
+++ csw/mgar/pkg/top/trunk/files/01.cmds.patch	2011-11-23 21:31:58 UTC (rev 16239)
@@ -0,0 +1,24 @@
+#
+# This patch was added for
+#    6820883 *top* segfaults when re-nicing
+#
+gdiff -Nurp top-3.8beta1/commands.c.orig top-3.8beta1/commands.c
+--- top-3.8beta1/commands.c.orig	2009-03-24 16:04:32.180557626 +0000
++++ top-3.8beta1/commands.c	2009-03-24 16:05:19.659662701 +0000
+@@ -501,13 +501,15 @@ renice_procs(char *str)
+     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

Added: csw/mgar/pkg/top/trunk/files/02.hash-c.patch
===================================================================
--- csw/mgar/pkg/top/trunk/files/02.hash-c.patch	                        (rev 0)
+++ csw/mgar/pkg/top/trunk/files/02.hash-c.patch	2011-11-23 21:31:58 UTC (rev 16239)
@@ -0,0 +1,79 @@
+#
+# This patch was included to address
+#    6893978 top segfaults with high thread ids
+#
+*** top-3.8beta1/hash.c-old  Thu Jul  2 15:30:55 2009
+--- top-3.8beta1/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);
+
+
+
+
+ 	  	 

Added: csw/mgar/pkg/top/trunk/files/03.sunos5.patch
===================================================================
--- csw/mgar/pkg/top/trunk/files/03.sunos5.patch	                        (rev 0)
+++ csw/mgar/pkg/top/trunk/files/03.sunos5.patch	2011-11-23 21:31:58 UTC (rev 16239)
@@ -0,0 +1,42 @@
+*** 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) == -1)
+! 	    {
+! 		(void) close(fd);
+! 		op->fd_psinfo = -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
+  

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list