git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fuse: Add tests for guestmount.
[libguestfs.git]
/
daemon
/
dir.c
diff --git
a/daemon/dir.c
b/daemon/dir.c
index
1ca6286
..
a5076b1
100644
(file)
--- a/
daemon/dir.c
+++ b/
daemon/dir.c
@@
-56,7
+56,7
@@
do_rm_rf (const char *path)
int r;
char *buf, *err;
int r;
char *buf, *err;
- if (
strcmp (path, "/") == 0
) {
+ if (
STREQ (path, "/")
) {
reply_with_error ("rm -rf: cannot remove root directory");
return -1;
}
reply_with_error ("rm -rf: cannot remove root directory");
return -1;
}
@@
-99,6
+99,23
@@
do_mkdir (const char *path)
return 0;
}
return 0;
}
+int
+do_mkdir_mode (const char *path, int mode)
+{
+ int r;
+
+ CHROOT_IN;
+ r = mkdir (path, mode);
+ CHROOT_OUT;
+
+ if (r == -1) {
+ reply_with_perror ("mkdir_mode: %s", path);
+ return -1;
+ }
+
+ return 0;
+}
+
static int
recursive_mkdir (const char *path)
{
static int
recursive_mkdir (const char *path)
{