X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Ffish.c;h=32d6f9f1d1b4ab75b30e18c1f8c8e9fc451a5c99;hb=4ff21ceb2561936fc2e204f0a02e6ca8fb8fd507;hp=4f515033e8cb0e94128cd11e14fa9f88955ee639;hpb=c372c7c23a298a940b8a0868396ef2ae0d824e4d;p=libguestfs.git diff --git a/fish/fish.c b/fish/fish.c index 4f51503..32d6f9f 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -139,6 +139,10 @@ main (int argc, char *argv[]) atexit (close_stdout); + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEBASEDIR); + textdomain (PACKAGE); + enum { HELP_OPTION = CHAR_MAX + 1 }; static const char *options = "a:Df:h::im:nrv?Vx"; @@ -322,10 +326,10 @@ main (int argc, char *argv[]) break; case HELP_OPTION: - usage (0); + usage (EXIT_SUCCESS); default: - usage (1); + usage (EXIT_FAILURE); } } @@ -470,10 +474,13 @@ mount_mps (struct mp *mp) if (mp) { mount_mps (mp->next); - if (!read_only) - r = guestfs_mount (g, mp->device, mp->mountpoint); - else - r = guestfs_mount_ro (g, mp->device, mp->mountpoint); + + /* Don't use guestfs_mount here because that will default to mount + * options -o sync,noatime. For more information, see guestfs(3) + * section "LIBGUESTFS GOTCHAS". + */ + const char *options = read_only ? "ro" : ""; + r = guestfs_mount_options (g, options, mp->device, mp->mountpoint); if (r == -1) exit (EXIT_FAILURE); }