From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 954DA7F8A0 for ; Mon, 24 Mar 2014 22:28:55 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=pra; client-ip=212.227.17.24; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=mailfrom; client-ip=212.227.17.24; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of postmaster@moutng.kundenserver.de designates 212.227.17.24 as permitted sender) identity=helo; client-ip=212.227.17.24; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="postmaster@moutng.kundenserver.de"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar8BACCjMFPU4xEYm2dsb2JhbABZg0GDXrg0hzWBJBYOAQEBAQEGCwsJFCiCJgEBBCMyJBALQgICVwYTCYd0CaxYom4XiS+FJSYHgi5BgUkEjySPbQWPEw X-IPAS-Result: Ar8BACCjMFPU4xEYm2dsb2JhbABZg0GDXrg0hzWBJBYOAQEBAQEGCwsJFCiCJgEBBCMyJBALQgICVwYTCYd0CaxYom4XiS+FJSYHgi5BgUkEjySPbQWPEw X-IronPort-AV: E=Sophos;i="4.97,723,1389740400"; d="asc'?scan'208";a="64525501" Received: from moutng.kundenserver.de ([212.227.17.24]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 24 Mar 2014 22:28:55 +0100 Received: from office1.lan.sumadev.de (dslb-088-069-153-061.pools.arcor-ip.net [88.69.153.61]) by mrelayeu.kundenserver.de (node=mreue104) with ESMTP (Nemesis) id 0MKZT5-1WU7ph1ybf-0023Gc; Mon, 24 Mar 2014 22:28:54 +0100 Received: from [192.168.10.103] (ip-37-201-194-198.unitymediagroup.de [37.201.194.198]) by office1.lan.sumadev.de (Postfix) with ESMTPSA id DBA8CDC270; Mon, 24 Mar 2014 22:28:53 +0100 (CET) Message-ID: <1395696533.27397.36.camel@zotac> From: Gerd Stolpmann To: Johan Grande Cc: caml users Date: Mon, 24 Mar 2014 22:28:53 +0100 In-Reply-To: <53307809.80202@ens-cachan.org> References: <53307809.80202@ens-cachan.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-fBlh9vyrlPJPay4zUdhB" X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 X-Provags-ID: V02:K0:bXlXFZr83CCtx94QUzGZlvTbnSI5nQf+N0IBossy18J TzfettX/VhK58mQdPSoU3t5ko2QtZB7RT3qdmkLZpzYhNghPBp dK0nwNNEIbkYkhpuiJg9g51Ue+Awf8D1FyRtAp/2GjSuHNVFo4 I5crFA3oaSORWJkILDMwxZKeGwqRcN+CXhGxUsL9MXSrRgoWvD hxmw9UOlcKclAuay1dfuM2a7TkfgqHt5fHPqMGf4D+8pZnZgUx YSk6gajAWg/Q0BoXzXs7O2MbtWDpoLSHPeXSDyL5reBto4VgGk 6/A9wsUrgpMI4WwCgZvpEcHvfc589NRfm12qTqELjuxjdM6vpE gOjZgEGeKCOISnZZF3W4V9ukQL1idWIMuYqbsO2kP Subject: Re: [Caml-list] Child process doesn't terminate --=-fBlh9vyrlPJPay4zUdhB Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Am Montag, den 24.03.2014, 19:23 +0100 schrieb Johan Grande: > Hi, >=20 > In the following program, the child process "cat" never terminates. I=20 > don't understand why; can anyone tell me? Because outdescr isn't closed in the child. Set the close-on-exec flag on it. Gerd > ~~~ > let _ =3D > let open Unix in > let indescr, outdescr =3D pipe () in > let outchan =3D out_channel_of_descr outdescr in > let pid =3D > create_process "/bin/cat" [|"cat"|] > indescr stdout stderr > in > Printf.fprintf outchan "Hello!\n%!"; > close indescr; > close outdescr; > ignore (waitpid [] pid) (* stuck here *) > ~~~ >=20 > --=20 > Johan Grande >=20 --=20 ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de My OCaml site: http://www.camlcity.org Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------ --=-fBlh9vyrlPJPay4zUdhB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAABAgAGBQJTMKOVAAoJEAaM4b9ZLB5TwQYH/2dbUJ1WnwbVjaadZqevsIo0 2esv7CQL9ASfDTkvU3RRtTXAKAhLt+cl1BWMg0C8AodTWf96ErKmetTIp5yqA6GV D6NvvkT0VKB2V4/yb3ml1JNiKTPLBQlMElgbe+J+u0rQkWUiAacmszCVt9F3Fd5a tV/MBfAln6ygrCUp9HD1qy58YHFzpxpt3d6cdFJZbREUAhYKkg3Fp4z19/xlkrCl 78UKGSVYCf2w4DaNzh0kApQL1W0nTxeyfIbfkVtovtY5l2zh9bt4Vu/I9+nWQwKe yCIJx39pobun+UVCscKaJziermoXANRSS6Y1g1kWb2XKiLp03YbD4huXCYoWd94= =TskP -----END PGP SIGNATURE----- --=-fBlh9vyrlPJPay4zUdhB--