From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11995 invoked by alias); 26 Mar 2009 10:38:35 -0000 Received: (qmail 11988 invoked by alias); 26 Mar 2009 10:38:35 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_13,SPF_HELO_PASS X-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_13,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion.fedora.phx.redhat.com Subject: fence-agents: master - fence_nss_wrapper: Fix minor polling bug and force wrapper to build To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: fence-agents.git X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 8afdf2dd77d943a908d915c2d16c58762054663d X-Git-Newrev: 883a960946bfe7e19e34354d837f6ad7157c93a6 From: Jan Friesse Message-Id: <20090326103814.B953F120324@lists.fedorahosted.org> Date: Thu, 26 Mar 2009 10:38:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q1/txt/msg00910.txt.bz2 Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=883a960946bfe7e19e34354d837f6ad7157c93a6 Commit: 883a960946bfe7e19e34354d837f6ad7157c93a6 Parent: 8afdf2dd77d943a908d915c2d16c58762054663d Author: Jan Friesse AuthorDate: Thu Mar 26 11:37:31 2009 +0100 Committer: Jan Friesse 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; } }