generator.ml: constify do_mkdtemp
[libguestfs.git] / daemon / ext2.c
index ab03528..f181b8d 100644 (file)
@@ -1,5 +1,5 @@
 /* libguestfs - the guestfsd daemon
- * Copyright (C) 2009 Red Hat Inc. 
+ * Copyright (C) 2009 Red Hat Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -36,8 +36,6 @@ do_tune2fs_l (const char *device)
   char **ret = NULL;
   int size = 0, alloc = 0;
 
-  IS_DEVICE (device, NULL);
-
   r = command (&out, &err, "/sbin/tune2fs", "-l", device, NULL);
   if (r == -1) {
     reply_with_error ("tune2fs: %s", err);
@@ -77,31 +75,31 @@ do_tune2fs_l (const char *device)
       do { colon++; } while (*colon && isspace (*colon));
 
       if (add_string (&ret, &size, &alloc, p) == -1) {
-       free (out);
-       return NULL;
+        free (out);
+        return NULL;
       }
       if (strcmp (colon, "<none>") == 0 ||
-         strcmp (colon, "<not available>") == 0 ||
-         strcmp (colon, "(none)") == 0) {
-       if (add_string (&ret, &size, &alloc, "") == -1) {
-         free (out);
-         return NULL;
-       }
+          strcmp (colon, "<not available>") == 0 ||
+          strcmp (colon, "(none)") == 0) {
+        if (add_string (&ret, &size, &alloc, "") == -1) {
+          free (out);
+          return NULL;
+        }
       } else {
-       if (add_string (&ret, &size, &alloc, colon) == -1) {
-         free (out);
-         return NULL;
-       }
+        if (add_string (&ret, &size, &alloc, colon) == -1) {
+          free (out);
+          return NULL;
+        }
       }
     }
     else {
       if (add_string (&ret, &size, &alloc, p) == -1) {
-       free (out);
-       return NULL;
+        free (out);
+        return NULL;
       }
       if (add_string (&ret, &size, &alloc, "") == -1) {
-       free (out);
-       return NULL;
+        free (out);
+        return NULL;
       }
     }
 
@@ -241,8 +239,6 @@ do_resize2fs (const char *device)
   char *err;
   int r;
 
-  IS_DEVICE (device, -1);
-
   r = command (NULL, &err, "/sbin/resize2fs", device, NULL);
   if (r == -1) {
     reply_with_error ("resize2fs: %s", err);
@@ -260,8 +256,6 @@ do_e2fsck_f (const char *device)
   char *err;
   int r;
 
-  IS_DEVICE (device, -1);
-
   r = command (NULL, &err, "/sbin/e2fsck", "-p", "-f", device, NULL);
   if (r == -1) {
     reply_with_error ("e2fsck: %s", err);