X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Fmount.c;h=4955fcf307704557f3110ea87af6dad28349ea72;hb=56bef498f46ac3dd580f4bde3c8f3ed2fe688826;hp=4e0ecdbac0e2ea35679888c989546fda54d0c662;hpb=e4733575efff31742444b180cdcfbc2504b144c8;p=libguestfs.git diff --git a/daemon/mount.c b/daemon/mount.c index 4e0ecdb..4955fcf 100644 --- a/daemon/mount.c +++ b/daemon/mount.c @@ -39,13 +39,15 @@ int root_mounted = 0; */ int -do_mount_vfs (const char *options, const char *vfstype, - const char *device, const char *mountpoint) +do_mount_vfs (char *options, char *vfstype, + char *device, char *mountpoint) { int len, r, is_root; char *mp; char *error; + IS_DEVICE (device, -1); + is_root = strcmp (mountpoint, "/") == 0; if (!root_mounted && !is_root) { @@ -82,20 +84,20 @@ do_mount_vfs (const char *options, const char *vfstype, } int -do_mount (const char *device, const char *mountpoint) +do_mount (char *device, char *mountpoint) { return do_mount_vfs ("sync,noatime", NULL, device, mountpoint); } int -do_mount_ro (const char *device, const char *mountpoint) +do_mount_ro (char *device, char *mountpoint) { return do_mount_vfs ("ro", NULL, device, mountpoint); } int -do_mount_options (const char *options, const char *device, - const char *mountpoint) +do_mount_options (char *options, char *device, + char *mountpoint) { return do_mount_vfs (options, NULL, device, mountpoint); } @@ -104,15 +106,16 @@ do_mount_options (const char *options, const char *device, * is kept updated. */ int -do_umount (const char *pathordevice) +do_umount (char *pathordevice) { int len, freeit = 0, r; char *buf; char *err; - if (strncmp (pathordevice, "/dev/", 5) == 0) - buf = (char *) pathordevice; - else { + if (strncmp (pathordevice, "/dev/", 5) == 0) { + buf = pathordevice; + IS_DEVICE (buf, -1); + } else { len = strlen (pathordevice) + 9; freeit = 1; buf = malloc (len);