All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] pan/ltp-pan.c: fix file descriptors leaks
Date: Tue, 10 Nov 2020 09:30:44 +0800	[thread overview]
Message-ID: <5FA9ED44.7080909@cn.fujitsu.com> (raw)
In-Reply-To: <20201109125938.GC9991@yuki.lan>

Hi Cyril, Feiyu
> Hi!
>> ltp-pan will leak file descriptors of fopen() into the child process
>> of the test case, fix this problem by using mode "e" for fopen().
>
> Looks good, however this is supported since glibc 2.7 and it does not
> seem to be supported on musl libc either.
>
Yes, musl-libc doesn't support "e" mode for fopen[1].

[1]https://git.musl-libc.org/cgit/musl/tree/src/stdio/fopen.c
> I guess that it would be better just to close these files after a fork
> in the runchild() function, but that would mean that we would have to
> pass all these files as paramters to the function as well.
+1
>




  reply	other threads:[~2020-11-10  1:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09 12:34 [LTP] [PATCH] pan/ltp-pan.c: fix file descriptors leaks Feiyu Zhu
2020-11-09 12:59 ` Cyril Hrubis
2020-11-10  1:30   ` Yang Xu [this message]
2020-11-10  2:56     ` Yang Xu
2020-11-10 10:26       ` Cyril Hrubis
2020-11-11  1:46         ` Yang Xu
2020-11-18  6:17           ` Yang Xu
2020-11-18 21:19             ` Petr Vorel
2020-11-19  3:00               ` Yang Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5FA9ED44.7080909@cn.fujitsu.com \
    --to=xuyang2018.jy@cn.fujitsu.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.