From: rpeterso@sourceware.org <rpeterso@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/group/tool main.c
Date: 9 Nov 2006 16:23:41 -0000 [thread overview]
Message-ID: <20061109162341.20204.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: rpeterso at sourceware.org 2006-11-09 16:23:41
Modified files:
group/tool : main.c
Log message:
This is the fix for Bugzilla Bug 214524: group_tool dump can give
short output.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/tool/main.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.21.2.1&r2=1.21.2.2
--- cluster/group/tool/main.c 2006/11/09 15:51:01 1.21.2.1
+++ cluster/group/tool/main.c 2006/11/09 16:23:41 1.21.2.2
@@ -343,11 +343,17 @@
return -1;
}
- rv = read(fd, inbuf, sizeof(inbuf));
- if (rv <= 0)
- printf("dump read returned %d errno %d\n", rv, errno);
- else
- write(STDOUT_FILENO, inbuf, rv);
+ while (1) {
+ rv = read(fd, inbuf, sizeof(inbuf));
+ fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK);
+ if (rv <= 0) {
+ if (errno != EAGAIN)
+ printf("dump read returned %d errno %d\n", rv, errno);
+ break;
+ }
+ else
+ write(STDOUT_FILENO, inbuf, rv);
+ }
close(fd);
return 0;
@@ -370,11 +376,17 @@
return -1;
}
- rv = read(fd, inbuf, sizeof(inbuf));
- if (rv <= 0)
- printf("dump read returned %d errno %d\n", rv, errno);
- else
- write(STDOUT_FILENO, inbuf, rv);
+ while (1) {
+ rv = read(fd, inbuf, sizeof(inbuf));
+ fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK);
+ if (rv <= 0) {
+ if (errno != EAGAIN)
+ printf("dump read returned %d errno %d\n", rv, errno);
+ break;
+ }
+ else
+ write(STDOUT_FILENO, inbuf, rv);
+ }
close(fd);
return 0;
next reply other threads:[~2006-11-09 16:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-09 16:23 rpeterso [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-12-01 15:26 [Cluster-devel] cluster/group/tool main.c teigland
2006-12-01 15:26 teigland
2006-12-01 15:26 teigland
2006-11-20 22:36 rpeterso
2006-11-09 16:22 rpeterso
2006-08-14 19:38 teigland
2006-07-31 18:38 teigland
2006-07-25 20:10 teigland
2006-07-14 18:57 teigland
2006-07-13 18:15 teigland
2006-06-28 19:58 teigland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061109162341.20204.qmail@sourceware.org \
--to=rpeterso@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).