1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
$NetBSD: patch-bb,v 1.2 2006/08/06 19:06:44 jmmv Exp $
From FreeBSD's GNOME development repository.
--- lib/write.c.orig 2006-04-10 10:41:46.000000000 +0200
+++ lib/write.c
@@ -22,6 +22,7 @@
*/
#include <config.h>
+#include <errno.h>
#include <glibtop/write.h>
#include <glibtop/error.h>
@@ -42,15 +43,19 @@ glibtop_write_l (glibtop *server, size_t
fprintf (stderr, "LIBRARY: really writing %d bytes.\n", (int)size);
#endif
+retry:
if (server->socket) {
ret = send (server->socket, buf, size, 0);
} else {
ret = write (server->output [1], buf, size);
}
- if (ret < 0)
+ if (ret < 0) {
+ if (errno == EINTR)
+ goto retry;
glibtop_error_io_r (server,
ngettext("wrote %d byte",
"wrote %d bytes", size),
(int) size);
+ }
}
|