From: keith.busch@intel.com (Keith Busch)
Subject: parse_and_open without closing the fd
Date: Mon, 20 Nov 2017 13:13:33 -0700 [thread overview]
Message-ID: <20171120201333.GB12587@localhost.localdomain> (raw)
In-Reply-To: <1c333ba1-5371-fa03-12fa-72ae42c7cc52@oracle.com>
On Mon, Nov 20, 2017@03:04:36PM -0500, Thomas Tai wrote:
> I am trying to add a new command in nvme-cli and use flush() in nvme.c as an
> example. The flush command use parse_and_open() to open the fd, but it never
> close the fd. I am wondering where about the fd is being closed.
It's implicitly closed on exit. This is a short-lived one-shot program,
so there is some laziness with accounting for all resources that are
automatically reclaimed. That said, it's still nice to clean this up as
we find such examples.
next prev parent reply other threads:[~2017-11-20 20:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-20 20:04 parse_and_open without closing the fd Thomas Tai
2017-11-20 20:13 ` Keith Busch [this message]
2017-11-20 20:11 ` Thomas Tai
2017-11-20 20:21 ` Keith Busch
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=20171120201333.GB12587@localhost.localdomain \
--to=keith.busch@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox