block: fix error reporting
authorJo-Philipp Wich <jo@mein.io>
Fri, 21 Oct 2016 13:46:25 +0000 (15:46 +0200)
committerJo-Philipp Wich <jo@mein.io>
Fri, 21 Oct 2016 13:46:25 +0000 (15:46 +0200)
commit13345aa36e13038a02a6dccf6b5181d9961dc2e0
tree50522584ed4bc04dfedb7dbd1d4ce31b425c48fa
parentcb3a8631e6e444b44851582d098bbaed76f2c742
block: fix error reporting

The current block code wrongly reported the return value of the mount() and
umount2() syscalls, which is always -1 in case the call failed.

Use errno and strerror(errno) instead to propagate the correct error code to
the user.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
block.c