Mercurial > oi > oi-build
changeset 361:22214726d642
6906587 top sometimes goes into infinite loop in getptable/hash_lookup_pidthr
author | M. Ajaykumar Venkatesulu <Ajaykumar.Venkatesulu@Sun.COM> |
---|---|
date | Sun, 03 Jul 2011 23:10:05 -0700 |
parents | 4fd3779cba48 |
children | e1cadde52f4c |
files | components/top/patches/03.sunos5.patch |
diffstat | 1 files changed, 17 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/components/top/patches/03.sunos5.patch Sun Jul 03 23:10:05 2011 -0700 @@ -0,0 +1,17 @@ +--- top-3.8beta1/machine/m_sunos5.c.orig Fri Jun 17 05:40:25 2011 ++++ top-3.8beta1/machine/m_sunos5.c Fri Jun 17 05:48:17 2011 +@@ -2064,7 +2064,13 @@ + + /* read the whole file */ + p = malloc(st.st_size); +- (void)pread(fd, p, st.st_size, 0); ++ 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)