parse_and_open without closing the fd

Thomas Tai thomas.tai at oracle.com
Mon Nov 20 12:11:28 PST 2017



On 2017-11-20 03:13 PM, Keith Busch wrote:
> 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.
> 

I see. Thanks Keith for your quick response.

-Thomas



More information about the Linux-nvme mailing list