openbsd-ports/devel/libgtop2/patches/patch-lib_read_c
2005-05-25 23:28:16 +00:00

32 lines
778 B
Plaintext

$OpenBSD: patch-lib_read_c,v 1.4 2005/05/25 23:28:16 marcm Exp $
--- lib/read.c.orig Tue Feb 15 04:48:33 2005
+++ lib/read.c Mon Apr 11 19:56:33 2005
@@ -22,6 +22,7 @@
*/
#include <config.h>
+#include <errno.h>
#include <glibtop/read.h>
#include <glibtop/error.h>
#include "libgtop-i18n.h"
@@ -56,14 +57,18 @@ glibtop_read_l (glibtop *server, size_t
fprintf (stderr, "LIBRARY: really reading %d bytes.\n", size);
#endif
+retry:
if (server->socket) {
do_read (server->socket, buf, size);
} else {
- if(read (server->input [0], buf, size) < 0)
+ if(read (server->input [0], buf, size) < 0) {
+ if (errno == EINTR)
+ goto retry;
glibtop_error_io_r (
server,
ngettext ("read %d byte",
"read %d bytes", size),
size);
+ }
}
}