mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-01-06 02:17:34 -08:00
Reworked patches to be -p1, and converted the two 'diff -c' context style diffs to a 'diff -u' unified diff, both for greater readability and a generally smaller filesize. Package-Manager: Portage-2.3.31, Repoman-2.3.9
29 lines
730 B
Diff
29 lines
730 B
Diff
https://hg.openindiana.org/upstream/oracle/userland-gate/raw-file/23c55a2f8a8e/components/top/patches/03.sunos5.patch
|
|
|
|
--- a/machine/m_sunos5.c
|
|
+++ b/machine/m_sunos5.c
|
|
@@ -2064,7 +2064,13 @@ getptable (struct prpsinfo *baseptr)
|
|
|
|
/* 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) != st.st_size)
|
|
+ {
|
|
+ (void) close(fd);
|
|
+ op->fd_lpsinfo = -1;
|
|
+ free(p);
|
|
+ continue;
|
|
+ }
|
|
|
|
/* cache the file descriptor if we can */
|
|
if (fd < maxfiles)
|
|
@@ -2148,7 +2154,7 @@ getptable (struct prpsinfo *baseptr)
|
|
op->oldtime = TIMESPEC_TO_DOUBLE(lwpp->pr_time);
|
|
op->seen = 1;
|
|
}
|
|
- free(p);
|
|
+ free(prp);
|
|
}
|
|
#endif
|
|
|