int
do_mount_vfs (char *options, char *vfstype,
- char *device, char *mountpoint)
+ char *device, char *mountpoint)
{
int r, is_root;
char *mp;
char *error;
- IS_DEVICE (device, -1);
-
is_root = strcmp (mountpoint, "/") == 0;
if (!root_mounted && !is_root) {
if (vfstype)
r = command (NULL, &error,
- "mount", "-o", options, "-t", vfstype, device, mp, NULL);
+ "mount", "-o", options, "-t", vfstype, device, mp, NULL);
else
r = command (NULL, &error,
- "mount", "-o", options, device, mp, NULL);
+ "mount", "-o", options, device, mp, NULL);
free (mp);
if (r == -1) {
reply_with_error ("mount: %s on %s: %s", device, mountpoint, error);
int
do_mount_options (char *options, char *device,
- char *mountpoint)
+ char *mountpoint)
{
return do_mount_vfs (options, NULL, device, mountpoint);
}
if (strncmp (pathordevice, "/dev/", 5) == 0) {
buf = pathordevice;
- IS_DEVICE (buf, -1);
+ RESOLVE_DEVICE (buf, return -1);
} else {
buf = sysroot_path (pathordevice);
if (buf == NULL) {
if (p2 != NULL) {
*p2 = '\0';
if (add_string (&ret, &size, &alloc, p) == -1) {
- free (out);
- return NULL;
+ free (out);
+ return NULL;
}
if (mp) {
- p2 += 4 + sysroot_len; /* skip " on /sysroot" */
- len = strcspn (p2, " ");
-
- if (len == 0) /* .. just /sysroot, so we turn it into "/" */
- p2 = (char *) "/";
- else
- p2[len] = '\0';
-
- if (add_string (&ret, &size, &alloc, p2) == -1) {
- free (out);
- return NULL;
- }
+ p2 += 4 + sysroot_len; /* skip " on /sysroot" */
+ len = strcspn (p2, " ");
+
+ if (len == 0) /* .. just /sysroot, so we turn it into "/" */
+ p2 = (char *) "/";
+ else
+ p2[len] = '\0';
+
+ if (add_string (&ret, &size, &alloc, p2) == -1) {
+ free (out);
+ return NULL;
+ }
}
}
p3 = p2 + strcspn (p2, " ");
*p3 = '\0';
if (add_string (&mounts, &size, &alloc, p2) == -1) {
- free (out);
- return -1;
+ free (out);
+ return -1;
}
}
char *error;
NEED_ROOT (-1);
- ABS_PATH (file, -1);
+ ABS_PATH (file, return -1);
/* We have to prefix /sysroot on both the filename and the mountpoint. */
mp = sysroot_path (mountpoint);
int r;
/* NEED_ROOT (-1); - we don't want this test for this call. */
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = mkdir (path, 0777);
int r;
NEED_ROOT (-1);
- ABS_PATH (path, -1);
+ ABS_PATH (path, return -1);
CHROOT_IN;
r = rmdir (path);