From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15607 invoked by alias); 1 Apr 2009 09:48:38 -0000 Received: (qmail 15460 invoked by alias); 1 Apr 2009 09:48:38 -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: cluster: STABLE3 - 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: cluster.git X-Git-Refname: refs/heads/STABLE3 X-Git-Reftype: branch X-Git-Oldrev: a68e594ae0461a82b8364b2a88e0698c0b0cad46 X-Git-Newrev: 463b02ad90caac5ca4d113e44d4a39a3275c2794 From: Jan Friesse Message-Id: <20090401094818.4BF35120346@lists.fedorahosted.org> Date: Wed, 01 Apr 2009 09:48: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-q2/txt/msg00003.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=463b02ad90caac5ca4d113e44d4a39a3275c2794 Commit: 463b02ad90caac5ca4d113e44d4a39a3275c2794 Parent: a68e594ae0461a82b8364b2a88e0698c0b0cad46 Author: Jan Friesse AuthorDate: Thu Mar 26 11:37:31 2009 +0100 Committer: Jan Friesse 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; } }