parse_and_open without closing the fd
Keith Busch
keith.busch at intel.com
Mon Nov 20 12:13:33 PST 2017
On Mon, Nov 20, 2017 at 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.
More information about the Linux-nvme
mailing list