Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Jun 2009 15:32:08 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Vlad Galu <dudu@dudu.ro>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: poll()-ing a pipe descriptor, watching for POLLHUP
Message-ID:  <20090603123208.GK1927@deviant.kiev.zoral.com.ua>
In-Reply-To: <ad79ad6b0906030515k2e41f4b9t25f752af8ef3866c@mail.gmail.com>
References:  <ad79ad6b0906030515k2e41f4b9t25f752af8ef3866c@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--P/XS8wfvSybnnBkt
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jun 03, 2009 at 03:15:32PM +0300, Vlad Galu wrote:
> Hello,
>=20
> Please take a look at the attached code. Shouldn't poll() get a
> POLLHUP event when the child process exits, closing the write end of
> the pipe?

It seems that you code forgot to close the write end of the pipe in
parent. Thus, pipe is referenced by another file descriptor from
the parent process, and you do not get close event.

--P/XS8wfvSybnnBkt
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkombUgACgkQC3+MBN1Mb4iUXwCguGpFVwSoqdLGQTXPgREz6qQ9
dVIAn27VmRGfYLY7sU4d4th1rvWFhfD8
=c69w
-----END PGP SIGNATURE-----

--P/XS8wfvSybnnBkt--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090603123208.GK1927>