int r;
char *err;
+ IS_DEVICE (device, -1);
+
r = command (NULL, &err, "/sbin/e2label", device, label, NULL);
if (r == -1) {
reply_with_error ("e2label: %s", err);
int r, len;
char *out, *err;
+ IS_DEVICE (device, NULL);
+
r = command (&out, &err, "/sbin/e2label", device, NULL);
if (r == -1) {
reply_with_error ("e2label: %s", err);
int r;
char *err;
+ IS_DEVICE (device, -1);
+
r = command (NULL, &err, "/sbin/tune2fs", "-U", uuid, device, NULL);
if (r == -1) {
reply_with_error ("tune2fs -U: %s", err);
int r;
char *out, *err, *p, *q;
+ IS_DEVICE (device, NULL);
+
/* It's not so straightforward to get the volume UUID. We have
* to use tune2fs -l and then look for a particular string in
* the output.
char *err;
int r;
+ IS_DEVICE (device, -1);
+
r = command (NULL, &err,
"/sbin/lvm", "pvcreate", device, NULL);
if (r == -1) {
int r, argc, i;
const char **argv;
+ Xphysvols;
+
argc = count_strings (physvols) + 3;
argv = malloc (sizeof (char *) * (argc + 1));
if (argv == NULL) {
char *err;
int r;
+ IS_DEVICE (device, -1);
+
r = command (NULL, &err,
"/sbin/lvm", "lvremove", "-f", device, NULL);
if (r == -1) {
char *err;
int r;
+ IS_DEVICE (device, -1);
+
r = command (NULL, &err,
"/sbin/lvm", "vgremove", "-f", device, NULL);
if (r == -1) {
char *err;
int r;
+ IS_DEVICE (device, -1);
+
r = command (NULL, &err,
"/sbin/lvm", "pvremove", "-ff", device, NULL);
if (r == -1) {
char *err;
int r;
+ IS_DEVICE (device, -1);
+
r = command (NULL, &err,
"/sbin/lvm", "pvresize", device, NULL);
if (r == -1) {
char *mp;
char *error;
+ IS_DEVICE (device, -1);
+
is_root = strcmp (mountpoint, "/") == 0;
if (!root_mounted && !is_root) {
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);