ports/devel/libgtop2/files/patch-lib::read.c
Alexander Nedotsukov 23b84554d8 - Fixes in proctime calculation.
- Fixes in procmem calculation.
- Clear libgtop_server2 responce structure to avoid use of
  uninitialized memory.
- Retry read/write after EINTR wich in fact is not an error.
- A number of glibtop_errors downgraded to glibtop_warns
  to avoid unxepected libgtop_server2 termination.
2003-09-09 03:35:10 +00:00

28 lines
592 B
C

--- lib/read.c.orig Fri May 7 07:09:24 1999
+++ lib/read.c Tue Sep 9 10:02:54 2003
@@ -21,6 +21,7 @@
Boston, MA 02111-1307, USA.
*/
+#include <errno.h>
#include <glibtop/read.h>
/* Reads some data from server. */
@@ -65,12 +66,16 @@
fprintf (stderr, "LIBRARY: really reading %d bytes.\n", size);
#endif
+retry:
if (server->socket) {
do_read (server->socket, buf, size);
} else {
ret = read (server->input [0], buf, size);
}
- if (ret < 0)
+ if (ret < 0) {
+ if (errno == EINTR)
+ goto retry;
glibtop_error_io_r (server, _("read %d bytes"), size);
+ }
}