X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Ffish.c;h=2022ee3ada8098aaf8e1bbf3f30719e4b9bfd4c8;hb=00a9ae7365e6bad258bcf079a18dcae94d0853ad;hp=dd73af74a22c2ae9c0900265c7c6b2c6a025f4e0;hpb=a6025c11d97ed5802b3729a93d224d2baa20ff12;p=libguestfs.git diff --git a/fish/fish.c b/fish/fish.c index dd73af7..2022ee3 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -28,6 +28,7 @@ #include #include #include +#include #ifdef HAVE_LIBREADLINE #include @@ -474,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); } @@ -1301,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 }