Source

oi-build / components / top / patches / 03.sunos5.patch

The default branch has multiple heads

Full commit
--- 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)