public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jan Friesse <honzaf@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: fence-agents: master - fence_nss_wrapper: Fix minor polling bug and force wrapper to build
Date: Thu, 26 Mar 2009 10:38:00 -0000	[thread overview]
Message-ID: <20090326103814.B953F120324@lists.fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=883a960946bfe7e19e34354d837f6ad7157c93a6
Commit:        883a960946bfe7e19e34354d837f6ad7157c93a6
Parent:        8afdf2dd77d943a908d915c2d16c58762054663d
Author:        Jan Friesse <jfriesse@redhat.com>
AuthorDate:    Thu Mar 26 11:37:31 2009 +0100
Committer:     Jan Friesse <jfriesse@redhat.com>
CommitterDate: Thu Mar 26 11:37:31 2009 +0100

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 08c1980..9973a29 100755
--- a/configure
+++ b/configure
@@ -331,6 +331,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 7c963ae..067d43a 100644
--- a/fence/agents/Makefile
+++ b/fence/agents/Makefile
@@ -1,6 +1,6 @@
 include ../../make/defines.mk
 
-SUBDIRS = ${fence_agents} lib
+SUBDIRS = ${fence_agents} lib nss_wrapper
 
 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;
       }
     }
 


                 reply	other threads:[~2009-03-26 10:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20090326103814.B953F120324@lists.fedorahosted.org \
    --to=honzaf@fedoraproject.org \
    --cc=cluster-cvs-relay@redhat.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).