FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 10-09-2012, 06:31 PM
Jan Pokorný
 
Default libcman: E{INTR, AGAIN} in cman_dispatch repeated read needs -1 too

Because otherwise, all you get during next cman_dispatch is noise
(i.e., the incoming messages are misaligned wrt. their boundaries).
In better case, this is captured as erroneous field value immediately,
otherwise the result will be pretty crazy.

The hypothetical "proper" fix is either:
- making sure EINTR/EAGAIN does not break atomicity of message
receiving (which in turn may break nonblocking character)
- the part of yet-read message is stored in the handle
(similar to reply_buf{fer,len} items)

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
---
cman/lib/libcman.c | 7 -------
1 file changed, 7 deletions(-)

diff --git a/cman/lib/libcman.c b/cman/lib/libcman.c
index 6ed8ecb..26c09f2 100644
--- a/cman/lib/libcman.c
+++ b/cman/lib/libcman.c
@@ -539,13 +539,6 @@ int cman_dispatch(cman_handle_t handle, int flags)
return -1;
}

- if (len < 0 &&
- (errno == EINTR || errno == EAGAIN)) {
- if (bufptr != buf)
- free(bufptr);
- return 0;
- }
-
if (len < 0) {
if (bufptr != buf)
free(bufptr);
--
1.7.11.4
 

Thread Tools




All times are GMT. The time now is 10:28 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org