summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-11-29 16:52:17 +0000
committerRichard W.M. Jones <rjones@redhat.com>2012-11-29 17:07:39 +0000
commit56937996142ea880f0d5e79f1223004c9ae19a1c (patch)
treedb3b497a3ce56e527cdb4b9e5d73e8612b98d00e
parentfc6f34d5cd5cbba4f6a55f9ed8d108acaeeeb64a (diff)
downloadlibguestfs-56937996142ea880f0d5e79f1223004c9ae19a1c.tar.gz
libguestfs-56937996142ea880f0d5e79f1223004c9ae19a1c.tar.xz
libguestfs-56937996142ea880f0d5e79f1223004c9ae19a1c.zip
inspection: Move variable decls to top of function.
This is just code motion.
-rw-r--r--src/inspect-fs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/inspect-fs.c b/src/inspect-fs.c
index ffcd0d68..0ddeae13 100644
--- a/src/inspect-fs.c
+++ b/src/inspect-fs.c
@@ -92,6 +92,8 @@ guestfs___check_for_filesystem_on (guestfs_h *g, const char *device,
int is_block, int is_partnum)
{
char *vfs_type;
+ int is_swap, r;
+ struct inspect_fs *fs;
/* Get vfs-type in order to check if it's a Linux(?) swap device.
* If there's an error we should ignore it, so to do that we have to
@@ -101,7 +103,7 @@ guestfs___check_for_filesystem_on (guestfs_h *g, const char *device,
vfs_type = guestfs_vfs_type (g, device);
guestfs_pop_error_handler (g);
- int is_swap = vfs_type && STREQ (vfs_type, "swap");
+ is_swap = vfs_type && STREQ (vfs_type, "swap");
debug (g, "check_for_filesystem_on: %s %d %d (%s)",
device, is_block, is_partnum,
@@ -111,12 +113,12 @@ guestfs___check_for_filesystem_on (guestfs_h *g, const char *device,
free (vfs_type);
if (extend_fses (g) == -1)
return -1;
- g->fses[g->nr_fses-1].is_swap = 1;
+ fs = &g->fses[g->nr_fses-1];
+ fs->is_swap = 1;
return 0;
}
/* Try mounting the device. As above, ignore errors. */
- int r;
guestfs_push_error_handler (g, NULL, NULL);
if (vfs_type && STREQ (vfs_type, "ufs")) { /* Hack for the *BSDs. */
/* FreeBSD fs is a variant of ufs called ufs2 ... */