Fix for re-reading /etc/mtab in zfs_is_mounted()
authorJohn Layman <jlayman@sagecloud.com>
Tue, 13 Aug 2013 19:24:58 +0000 (15:24 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 14 Aug 2013 18:37:06 +0000 (11:37 -0700)
When /etc/mtab is updated on Linux it's done atomically with
rename(2).  A new mtab is written, the existing mtab is unlinked,
and the new mtab is renamed to /etc/mtab.  This means that we
must close the old file and open the new file to get the updated
contents.  Using rewind(3) will just move the file pointer back
to the start of the file, freopen(3) will close and open the file.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1611


No differences found