cluster/group/tool main.c
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.
group/tool/main.c +22 -10
@@ -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 ;