X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Ffish.c;h=2022ee3ada8098aaf8e1bbf3f30719e4b9bfd4c8;hb=00a9ae7365e6bad258bcf079a18dcae94d0853ad;hp=7dae815daa8082455edb606986338b4fe52c4fa0;hpb=4d45c45f0928c7791429d351dc69b75167888f7d;p=libguestfs.git diff --git a/fish/fish.c b/fish/fish.c index 7dae815..2022ee3 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -28,6 +28,7 @@ #include #include #include +#include #ifdef HAVE_LIBREADLINE #include @@ -139,6 +140,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"; @@ -470,10 +475,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); } @@ -1297,7 +1305,11 @@ cleanup_readline (void) } close (fd); +#ifdef HAVE_APPEND_HISTORY (void) append_history (nr_history_lines, histfile); +#else + (void) write_history (histfile); +#endif } #endif }