public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: STABLE3 - fence_nss_wrapper: Fix minor polling bug and force wrapper to build
@ 2009-04-01  9:48 Jan Friesse
  0 siblings, 0 replies; only message in thread
From: Jan Friesse @ 2009-04-01  9:48 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=463b02ad90caac5ca4d113e44d4a39a3275c2794
Commit:        463b02ad90caac5ca4d113e44d4a39a3275c2794
Parent:        a68e594ae0461a82b8364b2a88e0698c0b0cad46
Author:        Jan Friesse <jfriesse@redhat.com>
AuthorDate:    Thu Mar 26 11:37:31 2009 +0100
Committer:     Jan Friesse <jfriesse@redhat.com>
CommitterDate: Wed Apr 1 11:47:55 2009 +0200

fence_nss_wrapper: Fix minor polling bug and force wrapper to build

We need build wrapper in any case, because it's ilo
dependency.

Polling had little problem, which DIDN'T affect ilo fence
agent.
---
 configure                                    |    1 +
 fence/agents/Makefile                        |    2 +-
 fence/agents/nss_wrapper/fence_nss_wrapper.c |    9 ++++-----
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index bbb6999..02bdfd1 100755
--- a/configure
+++ b/configure
@@ -687,6 +687,7 @@ if ((!$fence_agents) || ($fence_agents eq "all") || ($fence_agents eq "help")) {
     chomp;
     s|fence\/agents\/| |g;
     s|lib ||g;
+    s|nss_wrapper ||g;
     $all_fence = $_;
   }
   close IFILE;
diff --git a/fence/agents/Makefile b/fence/agents/Makefile
index 58f3dd9..f0f2dc9 100644
--- a/fence/agents/Makefile
+++ b/fence/agents/Makefile
@@ -1,7 +1,7 @@
 include ../../make/defines.mk
 
 ifdef fence_agents
-SUBDIRS = ${fence_agents} lib
+SUBDIRS = ${fence_agents} lib nss_wrapper
 endif
 
 all: ${SUBDIRS}
diff --git a/fence/agents/nss_wrapper/fence_nss_wrapper.c b/fence/agents/nss_wrapper/fence_nss_wrapper.c
index c6b3cda..6a21a12 100644
--- a/fence/agents/nss_wrapper/fence_nss_wrapper.c
+++ b/fence/agents/nss_wrapper/fence_nss_wrapper.c
@@ -373,7 +373,7 @@ int poll_cycle(PRFileDesc *socket,int mode) {
       return 0;
     }
 
-    if (pool[1].out_flags==PR_POLL_READ) {
+    if (pool[1].out_flags&PR_POLL_READ) {
       /*We have something in socket*/
       if ((readed_bytes=PR_Read(pool[1].fd,buffer,sizeof(buffer)))>0) {
         if (PR_Write(PR_STDOUT,buffer,readed_bytes)!=readed_bytes) {
@@ -387,7 +387,7 @@ int poll_cycle(PRFileDesc *socket,int mode) {
       }
     }
 
-    if (pool[0].out_flags==PR_POLL_READ) {
+    if (pool[0].out_flags&(PR_POLL_READ|PR_POLL_HUP)) {
       /*We have something in stdin*/
       if ((readed_bytes=PR_Read(pool[0].fd,buffer,sizeof(buffer)))>0) {
 
@@ -402,8 +402,9 @@ int poll_cycle(PRFileDesc *socket,int mode) {
           return 0;
         }
       } else {
-        /*End of stream -> quit*/
+        /*End of stream -> send EOL (if needed)*/
         if (!(mode&MODE_RAW)) {
+          eol_state+=100;
           convert_eols(NULL,0,buffer_eol,&bytes_to_write,&eol_state);
           if (PR_Write(pool[1].fd,buffer_eol,bytes_to_write)!=bytes_to_write) {
             print_nspr_error();
@@ -411,8 +412,6 @@ int poll_cycle(PRFileDesc *socket,int mode) {
             return 0;
           }
         }
-
-        can_exit=1;
       }
     }
 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-04-01  9:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-01  9:48 cluster: STABLE3 - fence_nss_wrapper: Fix minor polling bug and force wrapper to build Jan Friesse

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 read-only IMAP folder(s) and NNTP newsgroup(s).