fuse: fix return value of guestunmount for unmounted paths

Exit with 3 as return value when fusermount fails, because the specified
mount point is not considered mounted for the user.  This is in line
with what the guestunmount documentation says.

Adapt the test-guestunmount-fd test to the updated return value.

Thanks to: Maxim Perevedentsev.
This commit is contained in:
Pino Toscano
2015-11-23 17:09:14 +01:00
parent e49680bdd6
commit 51362c9638
2 changed files with 5 additions and 5 deletions

View File

@@ -220,7 +220,7 @@ main (int argc, char *argv[])
free (error);
exit (2);
exit (3);
/* success */
done:

View File

@@ -107,8 +107,8 @@ main (int argc, char *argv[])
}
/* Close the write side of the pipe. This should cause guestunmount
* to exit. It should exit with status code _2_ because we gave it
* a mountpoint which isn't a FUSE mountpoint.
* to exit. It should exit with status code _3_ because we gave it
* a directory which isn't a FUSE mountpoint.
*/
close (pipefd[1]);
@@ -117,10 +117,10 @@ main (int argc, char *argv[])
perror ("waitpid");
exit (EXIT_FAILURE);
}
if (!WIFEXITED (status) || WEXITSTATUS (status) != 2) {
if (!WIFEXITED (status) || WEXITSTATUS (status) != 3) {
char status_string[80];
fprintf (stderr, "%s: test failed: guestunmount didn't return status code 2; %s\n",
fprintf (stderr, "%s: test failed: guestunmount didn't return status code 3; %s\n",
guestfs_int_program_name,
guestfs_int_exit_status_to_string (status, "guestunmount",
status_string,