git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
TODO: Suggest including undelete utility.
[libguestfs.git]
/
fuse
/
guestmount.c
diff --git
a/fuse/guestmount.c
b/fuse/guestmount.c
index
df11619
..
e1cb2d8
100644
(file)
--- a/
fuse/guestmount.c
+++ b/
fuse/guestmount.c
@@
-40,6
+40,7
@@
#include <assert.h>
#include <sys/time.h>
#include <sys/types.h>
#include <assert.h>
#include <sys/time.h>
#include <sys/types.h>
+#include <locale.h>
#include <fuse.h>
#include <guestfs.h>
#include <fuse.h>
#include <guestfs.h>
@@
-652,7
+653,17
@@
fg_write (const char *path, const char *buf, size_t size,
dir_cache_invalidate (path);
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
}
static int
@@
-927,7
+938,7
@@
main (int argc, char *argv[])
struct mp *mps = NULL;
struct mp *mp;
char *p;
struct mp *mps = NULL;
struct mp *mp;
char *p;
- int c,
i,
r;
+ int c, r;
int option_index;
struct sigaction sa;
int option_index;
struct sigaction sa;