Jeff Squyres (jsquyres), le Wed 23 Apr 2014 21:05:55 +0000, a écrit :
> Any objections to this patch?  In OMPI, we're seeing this fd leak into child 
> processes.
> 
> diff --git a/src/topology-linux.c b/src/topology-linux.c
> index e934d4c..8c5fba1 100644
> --- a/src/topology-linux.c
> +++ b/src/topology-linux.c
> @@ -4601,6 +4601,13 @@ hwloc_linux_component_instantiate(struct 
> hwloc_disc_compo
>      data->is_real_fsroot = 0;
>    }
>  

We probably want an #ifdef FD_CLOEXEC here, not all systems have it.

> +  /* Since this fd stays open after hwloc returns, mark it as
> +     close-on-exec so that children don't inherit it */
> +  if (fcntl(root, F_SETFD, FD_CLOEXEC) == -1) {
> +      close(root);
> +      root = -1;
> +      goto out_with_data;
> +  }
>  #else
>    if (strcmp(fsroot_path, "/")) {
>      errno = ENOSYS;
> 
> -- 
> Jeff Squyres
> jsquy...@cisco.com
> For corporate legal information go to: 
> http://www.cisco.com/web/about/doing_business/legal/cri/
> 
> _______________________________________________
> hwloc-devel mailing list
> hwloc-de...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/hwloc-devel
> 

-- 
Samuel
 Je suis maintenant possesseur d'un ordinateur portable Compaq Armada
 1592DT avec port infra-rouge. Auriez-vous connaissance de programmes
 suceptibles d'utiliser ce port afin de servir de télécommande ?
 -+- JN in NPC : ben quoi, c'est pas à ça que ça sert ?

Reply via email to