equal
deleted
inserted
replaced
1 --- top-3.8beta1/machine/m_sunos5.c.orig Fri Jun 17 05:40:25 2011 |
1 *** top-3.8beta1/machine/m_sunos5.c.orig Wed Aug 31 05:23:52 2011 |
2 +++ top-3.8beta1/machine/m_sunos5.c Fri Jun 17 05:48:17 2011 |
2 --- top-3.8beta1/machine/m_sunos5.c Wed Aug 31 05:25:25 2011 |
3 @@ -2064,7 +2064,13 @@ |
3 *************** |
4 |
4 *** 2064,2070 **** |
5 /* read the whole file */ |
5 |
6 p = malloc(st.st_size); |
6 /* read the whole file */ |
7 - (void)pread(fd, p, st.st_size, 0); |
7 p = malloc(st.st_size); |
8 + if (pread(fd, p, st.st_size, 0) == -1) |
8 ! (void)pread(fd, p, st.st_size, 0); |
9 + { |
9 |
10 + (void) close(fd); |
10 /* cache the file descriptor if we can */ |
11 + op->fd_psinfo = -1; |
11 if (fd < maxfiles) |
12 + free(p); |
12 --- 2064,2076 ---- |
13 + continue; |
13 |
14 + } |
14 /* read the whole file */ |
15 |
15 p = malloc(st.st_size); |
16 /* cache the file descriptor if we can */ |
16 ! if (pread(fd, p, st.st_size, 0) == -1) |
17 if (fd < maxfiles) |
17 ! { |
|
18 ! (void) close(fd); |
|
19 ! op->fd_psinfo = -1; |
|
20 ! free(p); |
|
21 ! continue; |
|
22 ! } |
|
23 |
|
24 /* cache the file descriptor if we can */ |
|
25 if (fd < maxfiles) |
|
26 *************** |
|
27 *** 2148,2154 **** |
|
28 op->oldtime = TIMESPEC_TO_DOUBLE(lwpp->pr_time); |
|
29 op->seen = 1; |
|
30 } |
|
31 ! free(p); |
|
32 } |
|
33 #endif |
|
34 |
|
35 --- 2154,2160 ---- |
|
36 op->oldtime = TIMESPEC_TO_DOUBLE(lwpp->pr_time); |
|
37 op->seen = 1; |
|
38 } |
|
39 ! free(prp); |
|
40 } |
|
41 #endif |
|
42 |