summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-04-30 05:45:26 -0400
committerRichard W.M. Jones <rjones@redhat.com>2011-04-30 05:45:26 -0400
commit478b2d80ed1d613f621e89a97a0b140004ebac29 (patch)
tree560c918448e1d07b1962b9f252c6f617a980027d /src
parentb2f8627ab59daeb03f036dde6c66fb9da736950c (diff)
downloadlibguestfs-478b2d80ed1d613f621e89a97a0b140004ebac29.tar.gz
libguestfs-478b2d80ed1d613f621e89a97a0b140004ebac29.tar.xz
libguestfs-478b2d80ed1d613f621e89a97a0b140004ebac29.zip
guestfs_close: Move local variables close to code that uses them.
This is just code motion.
Diffstat (limited to 'src')
-rw-r--r--src/guestfs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/guestfs.c b/src/guestfs.c
index 7868e8f0..b2cf553a 100644
--- a/src/guestfs.c
+++ b/src/guestfs.c
@@ -169,9 +169,6 @@ guestfs_create (void)
void
guestfs_close (guestfs_h *g)
{
- int i;
- guestfs_h *gg;
-
if (g->state == NO_HANDLE) {
/* Not safe to call ANY callbacks here, so ... */
fprintf (stderr, _("guestfs_close: called twice on the same handle\n"));
@@ -219,6 +216,8 @@ guestfs_close (guestfs_h *g)
remove_tmpdir (g);
if (g->cmdline) {
+ int i;
+
for (i = 0; i < g->cmdline_size; ++i)
free (g->cmdline[i]);
free (g->cmdline);
@@ -231,6 +230,8 @@ guestfs_close (guestfs_h *g)
if (handles == g)
handles = g->next;
else {
+ guestfs_h *gg;
+
for (gg = handles; gg->next != g; gg = gg->next)
;
gg->next = g->next;