Module Name: src Committed By: yamt Date: Thu May 22 15:51:29 UTC 2014
Modified Files: src/external/bsd/top/dist [yamt-pagecache]: hash.c screen.c src/external/bsd/top/dist/machine [yamt-pagecache]: m_netbsd.c Log Message: sync with head. for a reference, the tree before this commit was tagged as yamt-pagecache-tag8. this commit was splitted into small chunks to avoid a limitation of cvs. ("Protocol error: too many arguments") To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.3.6.1 src/external/bsd/top/dist/hash.c cvs rdiff -u -r1.3.6.1 -r1.3.6.2 src/external/bsd/top/dist/screen.c cvs rdiff -u -r1.16.2.1 -r1.16.2.2 \ src/external/bsd/top/dist/machine/m_netbsd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/bsd/top/dist/hash.c diff -u src/external/bsd/top/dist/hash.c:1.3 src/external/bsd/top/dist/hash.c:1.3.6.1 --- src/external/bsd/top/dist/hash.c:1.3 Tue May 5 18:51:21 2009 +++ src/external/bsd/top/dist/hash.c Thu May 22 15:51:29 2014 @@ -579,7 +579,6 @@ hash_remove_pos_uint(hash_pos *pos) llistitem *li; void *ans; hash_item_uint *hi; - unsigned int key; /* sanity checks */ if (pos == NULL || pos->ll_last == pos->ll_item) @@ -597,9 +596,6 @@ hash_remove_pos_uint(hash_pos *pos) hi = (hash_item_uint *)li->datum; ans = hi->value; - /* free up the space */ - key = hi->key; - ; ll_freeitem(li); /* back up to previous item */ @@ -917,7 +913,6 @@ hash_remove_pos_pid(hash_pos *pos) llistitem *li; void *ans; hash_item_pid *hi; - pid_t key; /* sanity checks */ if (pos == NULL || pos->ll_last == pos->ll_item) @@ -936,8 +931,6 @@ hash_remove_pos_pid(hash_pos *pos) ans = hi->value; /* free up the space */ - key = hi->key; - ; ll_freeitem(li); /* back up to previous item */ @@ -1593,7 +1586,6 @@ hash_remove_pos_pidthr(hash_pos *pos) llistitem *li; void *ans; hash_item_pidthr *hi; - pidthr_t key; /* sanity checks */ if (pos == NULL || pos->ll_last == pos->ll_item) @@ -1612,8 +1604,6 @@ hash_remove_pos_pidthr(hash_pos *pos) ans = hi->value; /* free up the space */ - key = hi->key; - ; ll_freeitem(li); /* back up to previous item */ @@ -1932,7 +1922,6 @@ hash_remove_pos_lwpid(hash_pos *pos) llistitem *li; void *ans; hash_item_lwpid *hi; - lwpid_t key; /* sanity checks */ if (pos == NULL || pos->ll_last == pos->ll_item) @@ -1951,8 +1940,6 @@ hash_remove_pos_lwpid(hash_pos *pos) ans = hi->value; /* free up the space */ - key = hi->key; - ; ll_freeitem(li); /* back up to previous item */ Index: src/external/bsd/top/dist/screen.c diff -u src/external/bsd/top/dist/screen.c:1.3.6.1 src/external/bsd/top/dist/screen.c:1.3.6.2 --- src/external/bsd/top/dist/screen.c:1.3.6.1 Tue Apr 17 00:04:08 2012 +++ src/external/bsd/top/dist/screen.c Thu May 22 15:51:29 2014 @@ -273,8 +273,7 @@ screen_readtermcap(int interactive) /* set up common terminal capabilities */ if ((screen_length = tgetnum("li")) <= 0) { - screen_length = smart_terminal = 0; - return No; + screen_length = 0; } /* screen_width is a little different */ @@ -329,6 +328,13 @@ screen_readtermcap(int interactive) sets lower_left. */ screen_getsize(); + /* If screen_length is 0 from both termcap and ioctl then we are dumb */ + if (screen_length == 0) + { + smart_terminal = No; + return No; + } + /* if stdout is not a terminal, pretend we are a dumb terminal */ #ifdef USE_SGTTY if (ioctl(STDOUT, TIOCGETP, &old_settings) == -1) Index: src/external/bsd/top/dist/machine/m_netbsd.c diff -u src/external/bsd/top/dist/machine/m_netbsd.c:1.16.2.1 src/external/bsd/top/dist/machine/m_netbsd.c:1.16.2.2 --- src/external/bsd/top/dist/machine/m_netbsd.c:1.16.2.1 Wed Jan 23 00:04:38 2013 +++ src/external/bsd/top/dist/machine/m_netbsd.c Thu May 22 15:51:29 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: m_netbsd.c,v 1.16.2.1 2013/01/23 00:04:38 yamt Exp $ */ +/* $NetBSD: m_netbsd.c,v 1.16.2.2 2014/05/22 15:51:29 yamt Exp $ */ /* * top - a top users display for Unix @@ -37,12 +37,12 @@ * Andrew Doran <a...@netbsd.org> * * - * $Id: m_netbsd.c,v 1.16.2.1 2013/01/23 00:04:38 yamt Exp $ + * $Id: m_netbsd.c,v 1.16.2.2 2014/05/22 15:51:29 yamt Exp $ */ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: m_netbsd.c,v 1.16.2.1 2013/01/23 00:04:38 yamt Exp $"); +__RCSID("$NetBSD: m_netbsd.c,v 1.16.2.2 2014/05/22 15:51:29 yamt Exp $"); #endif #include <sys/param.h> @@ -587,7 +587,6 @@ get_proc_info(struct system_info *si, st int show_idle; int show_system; int show_uid; - int show_command; static struct handle handle; @@ -627,7 +626,6 @@ get_proc_info(struct system_info *si, st show_idle = sel->idle; show_system = sel->system; show_uid = sel->uid != -1; - show_command = sel->command != NULL; /* count up process states and get pointers to interesting procs */ total_procs = 0; @@ -687,7 +685,6 @@ get_lwp_info(struct system_info *si, str int show_idle; int show_system; int show_uid; - int show_command; static struct handle handle; @@ -739,7 +736,6 @@ get_lwp_info(struct system_info *si, str show_idle = sel->idle; show_system = sel->system; show_uid = sel->uid != -1; - show_command = sel->command != NULL; /* count up thread states and get pointers to interesting threads */ total_lwps = 0;