X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fuse%2Fguestmount.c;h=e1cb2d89e2a45ca390f9d8d7ff6f4414fbcba6e5;hb=11eeb8885c7a8ffb59e12cd5fb2ae0fc324df383;hp=df116196c6df0f3a0535561ae06abb0a4b62d89b;hpb=f93cbe5756cf052cce8049087afdcf714a3fc70c;p=libguestfs.git diff --git a/fuse/guestmount.c b/fuse/guestmount.c index df11619..e1cb2d8 100644 --- a/fuse/guestmount.c +++ b/fuse/guestmount.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -652,7 +653,17 @@ fg_write (const char *path, const char *buf, size_t size, dir_cache_invalidate (path); - return -ENOSYS; /* XXX */ + /* See fg_read. */ + const size_t limit = 2 * 1024 * 1024; + if (size > limit) + size = limit; + + int r; + r = guestfs_pwrite (g, path, buf, size, offset); + if (r == -1) + return error (); + + return r; } static int @@ -927,7 +938,7 @@ main (int argc, char *argv[]) struct mp *mps = NULL; struct mp *mp; char *p; - int c, i, r; + int c, r; int option_index; struct sigaction sa;