]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
zfs-functions.in: is_mounted() always returns 1
authorTerraTech <TerraTech@users.noreply.github.com>
Tue, 4 Dec 2018 17:57:29 +0000 (09:57 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 4 Dec 2018 17:57:29 +0000 (09:57 -0800)
commita0cc3726ed0b14ce43b0cfd4af4b703536a587c6
treefa8f87304aae8b77cdb116c85f198d34cd0fa91c
parentfedef6dd592cf6e83ab8fc8b81e5407d64f79996
zfs-functions.in: is_mounted() always returns 1

The 'while read line; ...; done' loop is run in a piped subshell
therefore the 'return 0' would not cause a return from the
is_mounted() function.  In all cases, this function will
always return 1.

The fix is to 'return 1' from the subshell on a successful match
(no match == return 0), and then negating the final return value.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: TerraTech <TerraTech@users.noreply.github.com>
Closes #8151
etc/init.d/zfs-functions.in